OFFSET
0,1
COMMENTS
If k=1 then 2*n+1 is a Mersenne exponent.
LINKS
Pierre CAMI, Table of n, a(n) for n = 0..2500
EXAMPLE
2*2^1-1=3 prime so a(0)=2.
1*2^3-1=7 prime so a(1)=1.
1*2^5-1=31 prime so a(2)=1.
MATHEMATICA
Table[k=1; While[Not[PrimeQ[k^2*2^(2*n+1)-1]], k++]; k, {n, 0, 100}] (* Vaclav Kotesovec, Dec 21 2014 *)
PROG
(PFGW & SCRIPT)
SCRIPT
DIM n, 0
DIM k
OPENFILEOUT myf, a(n).txt
LABEL loop1
SET n, n+1
SET k, 0
LABEL loop2
SET k, k+1
PRP k^2*2^(2*n+1)-1
IF ISPRP THEN GOTO a
GOTO loop2
LABEL a
WRITE myf, k
GOTO loop1
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, Dec 21 2014
STATUS
approved