A162253 Smallest value of the n-fold nesting prime(prime(...(k)...)) with a prime digital sum.
2, 3, 5, 11, 1787, 5381, 5381, 5381, 648391, 648391, 414507281407, 414507281407
Offset: 1
Examples
1st nesting is prime(1) = 2 which has a prime digit sum: a(0). The second nesting is prime(prime(1)) = 3, which has a prime digits sum: a(1)=3. The 3rd and 4th nesting also succeed for k=1 while the fifth nesting prime(prime(prime(prime(prime(4))))) = 1787 is the first occurrence of sum of digits is prime. Here nesting for k = 1,2,3 does not sum to a prime number.
Programs
-
PARI
for(j=1,12,print(j","sodip2(100,j)",")); sodip2(n,m) = \\multiple nesting of prime(prime(prime..(n) { local(s=0,a,x,y,j,p); for(x=1,n, for(i=1,m,p=prime2(p)); a=eval(Vec(Str(p))); y=sum(j=1,length(a),a[j]); if(isprime(y),return(p)); ) }
Formula
Extensions
Definition rephrased by R. J. Mathar, Jul 16 2009
Comments