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, Table of n, a(n) for n = 1..1500
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
KEYWORD
nonn
AUTHOR
Pierre CAMI, Mar 25 2017
STATUS
approved