login
A224966
Numbers n such that n^2+sum-of-digits(n^2) is prime.
1
1, 4, 10, 16, 31, 32, 40, 41, 43, 62, 71, 76, 94, 95, 97, 98, 121, 142, 158, 163, 164, 166, 179, 188, 208, 211, 214, 227, 229, 259, 260, 265, 284, 301, 313, 317, 320, 328, 331, 340, 352, 355, 356, 365, 380, 382, 386, 392, 397, 401, 418, 424, 425, 431, 436, 439
OFFSET
1,2
COMMENTS
This is the sequence of indices of prime numbers in A171613.
The Ulam spiral for this sequence is a near-perfect line y=-x (see links).
LINKS
Christian N. K. Anderson, Table of n, a(n) for n = 1..10000
Christian N. K. Anderson, The Ulam Spiral for the prime numbers derived from this sequence, i.e. a(n)^2+sum of digits(a(n)^2)
EXAMPLE
a(12)=76 because 76^2=5776, and 5776+(5+7+7+6)=5801, which is prime.
PROG
(R) library(gmp); digsum<-function(x) sum(as.numeric(unlist(strsplit(as.character(x), split=""))))
ans=as.bigz(rep(0, 100)); n=1; i=as.bigz(1)
while(n<=100) {
if(isprime((w=i^2+digsum(i^2)))) ans[(n=n+1)-1]=i
i=i+1
}; ans
CROSSREFS
Cf. A048521.
Cf. numbers of the form n^2+sum-of-digits(n^2) A171613, and subsets A171614, A171615.
Cf. A062028.
Sequence in context: A298031 A027425 A024992 * A069982 A009883 A333904
KEYWORD
nonn,base
STATUS
approved