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.

A373891 Number of primes less than prime(n) having the same difference between consecutive primes as prime(n).

Original entry on oeis.org

0, 0, 1, 0, 2, 1, 3, 2, 0, 4, 1, 3, 5, 4, 2, 3, 6, 4, 5, 7, 5, 6, 6, 0, 7, 8, 8, 9, 9, 0, 10, 7, 10, 0, 11, 8, 9, 11, 10, 11, 12, 1, 13, 12, 14, 0, 1, 13, 15, 14, 12, 16, 2, 13, 14, 15, 17, 16, 15, 18, 3, 1, 16, 19, 17, 2, 17, 4, 20, 18, 18, 1, 19, 20, 19, 21, 2, 20, 3, 5
Offset: 1

Views

Author

Ilya Gutkovskiy, Jun 21 2024

Keywords

Examples

			a(7) = 3 because A001223(7) = 2 and also A001223(2) = A001223(3) = A001223(5) = 2.
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Range[n - 1], Prime[# + 1] - Prime[#] == Prime[n + 1] - Prime[n] &]], {n, 80}]
  • PARI
    a(n) = my(vp = primes(n+1), dvp = vector(#vp-1, k, vp[k+1]-vp[k])); sum(i=1, #dvp-1, dvp[i] == dvp[#dvp]); \\ Michel Marcus, Jun 27 2024

Formula

a(n) = |{j < n : A001223(j) = A001223(n)}|.
a(n) = A274121(n) - 1.