OFFSET
1,1
COMMENTS
Primes n that are not k + A003132(k) for any nonprime k < n.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
N:= 1000: # to get the first N terms
res:= NULL: count := 0:
for n from 1 while count < N do
if isprime(n) then
if R[n] <> false then count:= count+1; res:= res, n fi
else
v:= n + add(t^2, t=convert(n, base, 10));
if isprime(v) then R[v]:= false fi;
fi
od:
res;
MATHEMATICA
With[{nn = 1200}, TakeWhile[#, # <= nn/2 &] &@ First@ Transpose@ TakeWhile[#, Last@ # == 1 &] &@ SortBy[#, Last] &@ Tally@ Array[NestWhile[# + Total[IntegerDigits[#]^2] &, #, ! PrimeQ@ # &] &, nn]] (* Michael De Vlieger, Oct 27 2016, after Harvey P. Dale at A094877 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Robert Israel, Oct 27 2016
STATUS
approved