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.

Showing 1-3 of 3 results.

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

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

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Nov 06 2016

Keywords

Examples

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

Crossrefs

Programs

  • Maple
    N:= 30: # for rows 2 to N
    res:= 1; p:= 3; R:= <1>;
    for n from 2 to N do
      pp:= nextprime(p);
      d:= pp - p;
      p:= pp;
      if d <= LinearAlgebra:-Dimension(R) then
        R[d]:= R[d]+1
      else
        R(d):= 1
      fi;
      res:= res, op(convert(R,list));
    od:
    res;  # Robert Israel, Nov 16 2016

A213949 One half of largest prime gap up to 10^n.

Original entry on oeis.org

1, 4, 10, 18, 36, 57, 77, 110, 141, 177, 232, 270, 337, 402, 453, 566, 610, 721
Offset: 1

Views

Author

Washington Bomfim, Jun 26 2012

Keywords

Comments

Row lengths of A213930.

Crossrefs

Formula

a(n) = A038460(n)/2.
Showing 1-3 of 3 results.