login
A210733
Least k > n-1 such that 4^n + 2^k - 1 is a prime number.
2
1, 2, 3, 4, 6, 6, 12, 9, 10, 10, 27, 13, 15, 22, 16, 16, 18, 19, 39, 22, 22, 43, 24, 24, 48, 26, 28, 43, 32, 38, 75, 33, 36, 58, 35, 57, 55, 47, 48, 52, 54, 72, 52, 51, 72, 54, 72, 53, 64, 62, 52, 52, 63, 60, 55, 60, 316, 70, 63, 68, 64, 96, 66, 115, 66, 92
OFFSET
1,2
COMMENTS
As n increases k is on average 1.43*n.
EXAMPLE
4^1+2^1-1=5 prime so a(1)=1.
4^2+2^2-1=19 prime so a(2)=2.
4^3+2^3-1=71 prime so a(3)=3.
MATHEMATICA
Table[k = n; While[! PrimeQ[4^n + 2^k - 1], k++]; k, {n, 100}] (* T. D. Noe, May 16 2012 *)
PROG
(PFGW64 and SCRIPTIFY)
Command : PFGW64 -f in.txt
in.txt file :
SCRIPT
DIM nn, 0
DIM kk
DIMS tt
OPENFILEOUT myfile, a(n).txt
LABEL loopn
SET nn, nn+1
SET kk, nn-1
LABEL loopk
SET kk, kk+1
SETS tt, %d, %d\,; nn; kk
PRP 4^nn+2^kk-1, tt
IF ISPRP THEN GOTO a
IF ISPRIME THEN GOTO a
GOTO loopk
LABEL a
WRITE myfile, tt
GOTO loopn
CROSSREFS
Sequence in context: A028335 A346117 A007464 * A265564 A064764 A340267
KEYWORD
nonn
AUTHOR
Pierre CAMI, May 10 2012
EXTENSIONS
Missing a(2103) inserted into b-file by Andrew Howroyd, Feb 24 2018
STATUS
approved