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.

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