OFFSET
1,5
COMMENTS
The smallest k generating a prime of the form (k+1)^p - k^p (A121620) for the prime A000040(n). For the primes p = 2, 3, 5, 7, 13, 17, 19, 31, 61, 89, 107, 127, ... (A000043), k = 1 and Mersenne primes 2^p - 1 (A000668) are obtained. For p = 11, 23, 29, ..., the smallest primes of the form (k+1)^p - k^p are respectively 313968931 (for k = 5), 777809294098524691 (for k = 5 also), 68629840493971 (for k = 2), ..., so a(5) = 5, a(9) = 5, a(10) = 2, ...
LINKS
Jinyuan Wang, Table of n, a(n) for n = 1..175
FORMULA
a(n) = A103794(n) - 1. - Ray Chandler, Feb 26 2017
MAPLE
A222119 := proc(n)
p := ithprime(n) ;
for k from 1 do
if isprime((k+1)^p-k^p) then
return k;
end if;
end do:
end proc: # R. J. Mathar, Feb 10 2013
MATHEMATICA
Table[p = Prime[n]; k = 1; While[q = (k + 1)^p - k^p; ! PrimeQ[q], k++]; k, {n, 80}] (* T. D. Noe, Feb 12 2013 *)
PROG
(PARI) f(p) = {my(k=1); while(ispseudoprime((k+1)^p-k^p)==0, k++); k; }
lista(nn) = forprime(p=2, nn, print1(f(p), ", ")); \\ Jinyuan Wang, Feb 03 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Pletser, Feb 07 2013
EXTENSIONS
More terms from Ray Chandler, Feb 27 2017
STATUS
approved