OFFSET
1,1
COMMENTS
The paper by Stein and Williams gives a method for finding primes of this form when k>(p+1)/2.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
Andreas Stein and H. C. Williams, Explicit primality criteria for (p-1)p^n-1, Math. Comp. 69 (2000), 1721-1734.
MAPLE
N:= 10^6: # for terms <= N
p:= 1: R:= NULL:
do
p:= nextprime(p);
if p^2 - p - 1 > N then break fi;
for k from 2 do
q:= p^k - p^(k-1)-1;
if q > N then break fi;
if isprime(q) then R:= R, q fi;
od od:
sort(convert({R}, list)); # Robert Israel, Mar 12 2023
MATHEMATICA
nn=10^6; lst={}; n=1; While[p=Prime[n]; k=2; While[m=p^k-p^(k-1)-1; m<nn, If[PrimeQ[m], AppendTo[lst, m]]; k++ ]; k>2, n++ ]; lst=Union[lst]
CROSSREFS
KEYWORD
nonn
AUTHOR
T. D. Noe, Aug 31 2006
STATUS
approved