login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

A207572
Least number k > 0 such that 3*prime(n)*2^k-1 is a prime number.
2
1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 3, 2, 2, 1, 1, 1, 1, 4, 1, 4, 7, 2, 8, 4, 2, 3, 1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 1, 1, 2, 5, 5, 15, 3, 11, 1, 1, 2, 3, 1, 1, 3, 1, 3, 2, 2, 3, 1, 2, 2, 2, 1, 8, 6, 10, 1, 1, 4, 3, 1, 5, 4, 1, 3, 1, 1, 1, 1, 1, 3, 12, 6, 2, 2, 3, 1, 1
OFFSET
1,5
EXAMPLE
3*2*2^1-1 = 11 prime so a(1)=1.
3*3*2^1-1 = 17 prime so a(2)=1.
3*5*2^1-1 = 29 prime so a(3)=1.
3*7*2^1-1 = 41 prime so a(4)=1.
3*11*2^1-1 = 65 composite.
3*11*2^2-1 = 131 prime so a(5)=2.
MATHEMATICA
Table[p = Prime[n]; k = 1; While[! PrimeQ[3*p*2^k - 1], k++]; k, {n, 100}] (* T. D. Noe, Feb 29 2012 *)
PROG
PFGW64 from Primeform group and SCRIPTIFY
Command pfgw64 -f in.txt
in.txt file :
SCRIPT
DIM nn, 0
DIM kk
DIMS tt
OPENFILEOUT myfile, k.txt
LABEL loopn
SET nn, nn+1
IF nn>50000 THEN END
SET kk, 0
LABEL loopk
SET kk, kk+1
SETS tt, %d, %d\,; nn; kk
PRP 3*p(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: A380481 A308638 A356320 * A380265 A380267 A289623
KEYWORD
nonn
AUTHOR
Pierre CAMI, Feb 20 2012
STATUS
approved