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”).
%I #19 Sep 30 2019 10:30:40
%S 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,
%T 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,
%U 34,4,14,49,83,3,39,87,4,10,116,128,53,13,1,32,57,92,27
%N Smallest k such that (6*k-3)*2^prime(n)-1 or (6*k-3)*2^prime(n)+1 is prime.
%C 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.
%C For n from 1 to 1500 a(n)/prime(n) is always < 1.
%H Pierre CAMI, <a href="/A284325/b284325.txt">Table of n, a(n) for n = 1..1500</a>
%H Pierre CAMI, <a href="/A284325/a284325.txt">PFGW Script</a>
%t 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 *)
%t 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 *)
%o (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
%K nonn
%O 1,6
%A _Pierre CAMI_, Mar 25 2017