A242796 Least number k such that (k^k-n)/(k-n) is prime, or 0 if no such k exists.
2, 4, 6, 5, 0, 13, 9, 11, 0, 12, 22, 13, 37, 28, 36, 0, 0, 171, 73, 85, 0, 0, 0, 29, 0, 0, 0, 0, 517, 35, 40, 49, 44, 49, 0, 41, 46, 40, 0, 0, 51, 0, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2841, 0, 0, 0, 0, 0, 0, 67, 0, 64, 0, 199, 125, 221, 0, 0, 153, 113, 239, 0, 97, 0, 0, 0
Offset: 1
Examples
(1^1-2)/(1-2) = 1 is not prime. (3^3-2)/(3-2) = 25 is not prime. (4^4-2)/(4-2) = 254/2 = 127 is prime. Thus a(2) = 4.
Programs
-
PARI
a(n)=for(k=1,5000,if(k!=n,s=(k^k-n)/(k-n);if(floor(s)==s,if(ispseudoprime(s),return(k))))); n=1;while(n<100,print(a(n));n+=1)
Extensions
We don't normally allow conjectural terms, except in special circumstances. This is one of those exceptions, for if we included only terms that are known for certain, not much of this sequence would remain. - N. J. A. Sloane, May 31 2014
Comments