login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A098929
Smallest k>0 such that (2^k)*A002110(n) + 1 is prime.
2
1, 1, 1, 1, 1, 2, 3, 11, 2, 4, 1, 2, 3, 15, 23, 6, 11, 1, 7, 6, 7, 10, 1, 9, 28, 1, 3, 7, 63, 1, 25, 29, 13, 3, 25, 12, 9, 18, 20, 15, 66, 3, 5, 39, 10, 37, 15, 14, 31, 6, 9, 27, 12, 7, 15, 12, 6, 11, 41, 35, 116, 15, 7, 28, 6, 9, 23, 28, 23, 2, 2, 9, 5, 17, 27, 56, 69, 132, 29, 1, 20, 17
OFFSET
1,6
MATHEMATICA
f[n_] := Block[{k = 1, p = Product[Prime[i], {i, n}]}, While[ !PrimeQ[2^k*p + 1], k++ ]; k]; Table[ f[n], {n, 82}]
PROG
(PFGW & SCRIPT)
Command pfgw64 -f in.txt
in.txt = SCRIPT file
SCRIPT
DIM n, 0
DIM i, 0
DIM pp
DIMS t
OPENFILEOUT myf, a(n).txt
LABEL loop1
SET n, n+1
SET i, 0
LABEL loop2
SET i, i+1
SETS t, %d, %d, %d\,; n; p(n); i
SET pp, (2^i)*p(n)#+1
PRP pp, t
IF ISPRP THEN GOTO a
GOTO loop2
LABEL a
WRITE myf, t
GOTO loop1
CROSSREFS
Sequence in context: A002443 A111788 A238455 * A073098 A201267 A046641
KEYWORD
nonn
AUTHOR
STATUS
approved