login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A259567
Number of subsequent numbers, starting with n, for which A258881(x) = x + (sum of squares of digits of x) is prime.
3
0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
OFFSET
0,11
COMMENTS
This sequence is motivated by sequence A259391 and the "Prime puzzle 776".
FORMULA
If a(n) > 0, then a(n+1) = a(n)-1.
a(n) > 0 iff n is in A076161.
EXAMPLE
For n = 0, A258881(0) = 0 is not prime.
For n = 1, A258881(1) = 1+1 = 2 is prime, but A258881(2) = 2+4 is not prime, therefore a(1)=1.
For n = 10, A258881(10) = 10 + 1^2 + 0^2 = 11, A258881(11) = 11 + 1^2 + 1^2 = 13, A258881(12) = 12 + 1^2 + 2^2 = 17, ..., A258881(19) = 19 + 1^2 + 9^2 = 101 are all prime, but A258881(20) = 20 + 2^2 + 0^2 is not prime, therefore a(10) = 10.
The next value of 10 occurs at index n = 1761702690, see A259391.
PROG
(PARI) a(n)=for(m=n, n+9e9, isprime(A258881(m))||return(m-n))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
M. F. Hasler, Jul 19 2015
STATUS
approved