cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A284325 Smallest k such that (6*k-3)*2^prime(n)-1 or (6*k-3)*2^prime(n)+1 is prime.

Original entry on oeis.org

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

Views

Author

Pierre CAMI, Mar 25 2017

Keywords

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.

Programs

  • 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 *)
  • 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