OFFSET
1,1
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..2900
EXAMPLE
11 is a member since 11 - 2 = 3^2 where 3 is prime. 2903 is a member since 2903 - 94 = 53^2 where 53 is prime.
MAPLE
ssd:= n->add(d^2, d=convert(n, base, 10));
S:= select(t -> type(sqrt(t - ssd(t)), prime), [seq(ithprime(j), j=1..10^5)]);
MATHEMATICA
fQ[n_] := PrimeQ[ Sqrt[ n - Total[ IntegerDigits[ n]^2]]]; p = 2; lst = {}; While[p < 15500000, If[ fQ@ p, AppendTo[ lst, p]]; p = NextPrime@ p]; lst (* Robert G. Wilson v, Jun 01 2014 *)
PROG
(PARI) ssd(n)=my(d=digits(n)); sum(i=1, #d, d[i]^2)
v=List(); forprime(p=2, 1e5, if(issquare(p-ssd(p), &t) && isprime(t), listput(v, p))); Vec(v)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
STATUS
approved