login
A243404
Least number k such that n^k - n^(k-1) - ... - n^2 - n - 1 is prime.
0
1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 564, 1, 10, 2, 2, 1, 14, 1, 2, 2, 8, 1, 2, 5, 2, 3, 2, 1, 2, 1, 252, 3, 20, 2, 6, 1, 2, 2, 4, 1, 24, 1, 2, 2, 2, 1, 2, 3, 2, 17, 24, 1, 2, 2, 2, 3, 4, 1, 2, 1, 4, 11, 2, 2, 2, 1, 2, 555, 2, 1, 8, 1, 12, 3, 2, 3, 6, 1, 4, 6, 680, 1, 6, 2, 2, 3, 132
OFFSET
3,3
COMMENTS
a(n) = 1 iff n-1 is prime.
EXAMPLE
5^1 - 5^0 = 4 is not prime. 5^2 - 5^1 - 5^0 = 19 is prime. Thus a(5) = 2.
PROG
(PARI) a(n)=for(k=1, 10^3, if(ispseudoprime(n^k-sum(i=0, k-1, n^i)), return(k)))
n=1; while(n<100, print1(a(n), ", "); n++)
CROSSREFS
Sequence in context: A048684 A191613 A298642 * A219181 A347833 A260341
KEYWORD
nonn
AUTHOR
Derek Orr, Jun 04 2014
STATUS
approved