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

A240235
Least number k such that k*n^k - 1 is prime. a(n) = 0 if no such number exists.
4
3, 2, 1, 1, 8, 1, 2, 1, 10, 2, 2, 1, 2, 1, 2, 167, 2, 1, 12, 1, 2, 2, 29028, 1, 2, 3, 10, 2, 26850, 1, 8, 1, 42, 2, 6, 2, 24, 1, 2, 3, 2, 1, 2, 1, 2, 2, 140, 1, 2, 2, 22, 2, 8, 1, 2064, 2, 468, 6, 2, 1, 362, 1, 2, 2, 6, 3, 26, 1, 2, 3, 20, 1, 2, 1, 28, 2, 38, 5, 3024, 1, 2, 81, 858, 1
OFFSET
1,1
COMMENTS
a(n) = 1 iff n-1 is prime.
a(145) is either 0 or > 275000. - Robert G. Wilson v, Jan 23 2017
LINKS
EXAMPLE
1*1^1 - 1 = 0 is not prime. 2*1^2 - 1 = 1 is not prime. 3*1^3 - 1 = 2 is prime. Thus, a(1) = 3.
PROG
(PARI) a(n)=k=1; while(!ispseudoprime(k*n^k-1), k++); return(k); n=1; while(n<100, print(a(n)); n+=1)
CROSSREFS
KEYWORD
nonn
AUTHOR
Derek Orr, Apr 02 2014
EXTENSIONS
a(23) and a(29) given using link. - Derek Orr, Aug 16 2014
STATUS
approved