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.

A228669 Numbers k for which sum{prime(2*k) - prime(2*k-1)} is prime.

Original entry on oeis.org

2, 3, 4, 5, 6, 9, 14, 16, 19, 21, 23, 25, 26, 27, 32, 34, 35, 36, 37, 38, 43, 44, 49, 50, 55, 63, 64, 65, 70, 73, 76, 81, 96, 101, 107, 113, 121, 126, 129, 132, 135, 145, 147, 152, 154, 157, 158, 160, 161, 166, 171, 174, 176, 179, 180, 183, 187, 196, 197
Offset: 1

Views

Author

Clark Kimberling, Oct 01 2013

Keywords

Examples

			a(6) = 9 because 3-2 + 7-5 + 13-11 + 19-17 + 29-23 + 37-31 = 19 =
A077133(6) is a prime.
		

Crossrefs

Cf. A077133.

Programs

  • Mathematica
    z = 300; f[n_] := Sum[Prime[2 k] - Prime[2 k - 1], {k, 1, n}]
    Table[f[n], {n, 1, z}]  (* A077133 *)
    g[n_] := If[PrimeQ[f[n]], 1, 0]; t = Table[g[n], {n, 1, z}]; Flatten[Position[t, 1]]
    Position[Accumulate[#[[2]]-#[[1]]&/@Partition[Prime[Range[400]],2]], ?PrimeQ]//Flatten (* _Harvey P. Dale, Jul 26 2018 *)