OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..3000
EXAMPLE
11 is prime and 11 - (1+1) = 9 = 3^2 is square, so 11 is a term of the sequence.
457 is prime and 457 - (4+5+7) = 441 = 21^2 is square, so 457 is a term of the sequence.
2939 is prime and 2939 - (2+9+3+9) = 2916 = 54^2 is square, so 2939 is a term of the sequence.
101 is prime and 101 - (1+0+1) = 99 is not square, so 101 is not a term of the sequence.
MAPLE
select(t -> isprime(t) and issqr(t - convert(convert(t, base, 10), `+`)),
[2, seq(i, i=3..20000, 2)]); # Robert Israel, Apr 15 2019
MATHEMATICA
Select[Prime@ Range@ 2000, IntegerQ@ Sqrt[# - Total@ IntegerDigits@ #] &] (* Michael De Vlieger, Nov 05 2018 *)
PROG
(PARI) isok(p) = isprime(p) && issquare(p-sumdigits(p)); \\ Michel Marcus, Oct 30 2018
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Marius A. Burtea, Oct 28 2018
EXTENSIONS
a(26) corrected by Robert Israel, Apr 15 2019
STATUS
approved