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”).

A284325
Smallest k such that (6*k-3)*2^prime(n)-1 or (6*k-3)*2^prime(n)+1 is prime.
3
1, 1, 1, 1, 1, 2, 2, 5, 8, 8, 3, 3, 1, 1, 5, 9, 5, 12, 2, 7, 3, 12, 9, 9, 9, 14, 1, 14, 2, 18, 35, 56, 19, 38, 38, 26, 3, 13, 74, 12, 25, 12, 11, 8, 37, 79, 2, 43, 68, 3, 12, 46, 54, 7, 9, 9, 34, 4, 14, 49, 83, 3, 39, 87, 4, 10, 116, 128, 53, 13, 1, 32, 57, 92, 27
OFFSET
1,6
COMMENTS
As N increases,(Sum_{n=1..N} a(n)) / (Sum_{n=1..N} prime(n)) tends to log(2)/6 as can be seen by ploting data.
For n from 1 to 1500 a(n)/prime(n) is always < 1.
LINKS
Pierre CAMI, PFGW Script
MATHEMATICA
a[n_]:=Block[{k=1}, While[!PrimeQ[(6k - 3)*2^Prime[n] - 1] && !PrimeQ[(6k - 3)*2^Prime[n] + 1], k++]; k]; Table[a[n], {n, 100}] (* Indranil Ghosh, Mar 25 2017, translated from the PARI code *)
sk[n_]:=Module[{k=1, t=2^Prime[n]}, While[NoneTrue[(6k-3)t+{1, -1}, PrimeQ], k++]; k]; Array[sk, 80] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Sep 30 2019 *)
PROG
(PARI) a(n) = my(k=1); while(!isprime((6*k-3)*2^prime(n)-1) && !isprime((6*k-3)*2^prime(n)+1), k++); k; \\ Michel Marcus, Mar 25 2017
CROSSREFS
Sequence in context: A210804 A087910 A327597 * A358517 A035570 A286559
KEYWORD
nonn
AUTHOR
Pierre CAMI, Mar 25 2017
STATUS
approved