OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(1) = 3*(2^2)+1 = 13.
a(2) = 7*(2^2)+1 = 29.
a(3) = 13*(2^2)+1 = 53.
MAPLE
N:= 10000: # for all terms <= N
Res:= NULL:
P:= select(isprime, [2, seq(i, i=3..N/4, 2)]):
for b from 2 do
q:= b^b; if q > N/2 then break fi;
for i from 1 to nops(P) do
x:= P[i]*q+1;
if x > N then break fi;
if isprime(x) then Res:= Res, x fi;
od od:
sort(convert({Res}, list)); # Robert Israel, Nov 12 2019
MATHEMATICA
nmax=10^4; pimax=PrimePi[nmax]; bmax=1; While[(bmax+1)^(bmax+1)<=nmax, bmax++]; Select[Union@Flatten@Table[Prime[pi] b^b+1, {b, 2, bmax}, {pi, pimax}], PrimeQ[#]&&#<=nmax&]
PROG
(PARI) list(lim)=my(v=List()); lim\=1; for(b=2, oo, my(p=2*b^b+1); if(p>lim, break); if(isprime(p), listput(v, p))); forstep(b=2, oo, 2, my(B=b^b); if(3*B+1>lim, break); forprime(q=3, (lim-1)\B, my(p=q*B+1); if(isprime(p), listput(v, p)))); Set(v) \\ Charles R Greathouse IV, Jun 16 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, May 12 2017
STATUS
approved