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”).

Least number k such that (k^k-n^n)/(k-n) is prime or 0 if no such number exists.
0

%I #16 Oct 21 2014 12:39:51

%S 2,1,1,3,3,7,3,0,0,11,5,0,4,0,0,7,16,0,1,0,281,0,19,0,0,0,7,0,35,0,1,

%T 0,113,0,29,91,19,0,19,0,23,0,0,0,0,37,65,0,0,0,0,0,153,0,199,0,0,115,

%U 0,0,0,0,319,0,47,0,0,0,13,0,47,0,0,0,539,0,0,0,0,0,13,0,147

%N Least number k such that (k^k-n^n)/(k-n) is prime or 0 if no such number exists.

%C a(n) = 0 is confirmed for k <= 5000. (Which means that the zeros are at present only conjectural. - _N. J. A. Sloane_, May 26 2014)

%C If a(i) = j, then a(j) <= i for all i and j.

%e (2^2-1^1)/(2-1) = 3 is prime. Thus a(1) = 2.

%o (PARI) a(n)=for(k=1,5000,if(k!=n,s=(k^k-n^n)/(k-n);if(floor(s)==s,if(ispseudoprime(s),return(k)))))

%o n=1;while(n<100,print(a(n));n+=1)

%K nonn,hard,more

%O 1,1

%A _Derek Orr_, May 25 2014

%E 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