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.

A277730 Irregular triangle read by rows: T(n,k) = number of times a gap of 2k occurs between the first n successive odd primes.

Original entry on oeis.org

1, 2, 2, 1, 3, 1, 3, 2, 4, 2, 4, 3, 4, 3, 1, 5, 3, 1, 5, 3, 2, 5, 4, 2, 6, 4, 2, 6, 5, 2, 6, 5, 3, 6, 5, 4, 7, 5, 4, 7, 5, 5, 7, 6, 5, 8, 6, 5, 8, 6, 6, 8, 7, 6, 8, 7, 7, 8, 7, 7, 1, 8, 8, 7, 1, 9, 8, 7, 1, 9, 9, 7, 1, 10, 9, 7, 1, 10, 10, 7, 1, 10, 10, 7, 1, 0, 0, 1, 10, 11, 7, 1, 0, 0, 1
Offset: 2

Views

Author

N. J. A. Sloane, Nov 06 2016

Keywords

Comments

T(m, 2) = max{T(m, k): k >= 1} for m >= 100. - Ya-Ping Lu, Dec 25 2024

Examples

			Triangle begins:
  1,
  2,
  2, 1,
  3, 1, <- gaps in 3,5,7,11,13 are 2 (3 times), 4 (once)
  3, 2,
  4, 2,
  4, 3,
  4, 3, 1,
  5, 3, 1,
  5, 3, 2,
  5, 4, 2,
  6, 4, 2,
  6, 5, 2,
  6, 5, 3,
  6, 5, 4,
  7, 5, 4,
  7, 5, 5,
  7, 6, 5,
  8, 6, 5,
  ...
		

Crossrefs

Programs

  • Python
    from sympy import nextprime; p = 3; L = []
    for n in range(2, 32):
        np = nextprime(p); k = (np - p)//2
        if len(L) < k: {L.append(0) for i in range(len(L), k-1)}; L.append(1)
        else: L[k-1] += 1
    print(*L, sep =", ", end = ", "); p = np  # Ya-Ping Lu, Dec 25 2024