OFFSET
1,1
COMMENTS
214007 is the smallest term that is in A017353 and 31111009 is the smallest term that is in A017377. - Altug Alkan, Aug 16 2017
LINKS
Robert Israel, Table of n, a(n) for n = 1..4000
EXAMPLE
a(3) = 3331 is prime: [3^2 + 3^2 + 3^2 + 1^2 = 9 + 9 + 9 + 1] = 28; [3331^2 = 11095561, 1 + 1 + 0 + 9 + 5 + 5 + 1] = 28.
a(5) = 11243 is prime: [1^2 + 1^2 + 2^2 + 4^2 + 3^2 = 1 + 1 + 4 + 16 + 9] = 31: [11243^2 = 126405049;1 + 2 + 6 + 4 + 0 + 5 + 0 + 4 + 9] = 31.
MAPLE
filter:= t -> convert(map(`^`, convert(t, base, 10), 2), `+`) = convert(convert(t^2, base, 10), `+`) and isprime(t):
select(filter, [2, seq(i, i=3..200000, 2)]); # Robert Israel, Aug 16 2017
MATHEMATICA
Select[Prime[Range[20000]], Plus @@ IntegerDigits[#^2] == Total[IntegerDigits[#]^2] &]
PROG
(PARI) forprime(p=1, 30000, v=digits(p); if(sum(i=1, length(v), v[i]^2) == sumdigits(p^2), print1(p", ")));
CROSSREFS
KEYWORD
nonn,base
AUTHOR
K. D. Bajpai, Aug 16 2017
STATUS
approved