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.

A086800 Triangle read by rows in which row n lists differences between prime(n) and prime(k) for 1 <= k <= n.

Original entry on oeis.org

0, 1, 0, 3, 2, 0, 5, 4, 2, 0, 9, 8, 6, 4, 0, 11, 10, 8, 6, 2, 0, 15, 14, 12, 10, 6, 4, 0, 17, 16, 14, 12, 8, 6, 2, 0, 21, 20, 18, 16, 12, 10, 6, 4, 0, 27, 26, 24, 22, 18, 16, 12, 10, 6, 0, 29, 28, 26, 24, 20, 18, 14, 12, 8, 2, 0, 35, 34, 32, 30, 26, 24, 20, 18, 14, 8, 6, 0
Offset: 1

Views

Author

Cino Hilliard, Aug 05 2003

Keywords

Comments

Primes in this sequence are of course twin primes.

Examples

			2-2=0; 3-2=1, 3-3=0; 5-2=3, 5-3=2, 5=5=5; 7-2=5, 7-3=4, 7-5=2, 7-7=0, ...
Triangle begins:
  0;
  1, 0;
  3, 2, 0;
  5, 4, 2, 0;
  9, 8, 6, 4, 0;
  11, 10, 8, 6, 2, 0;
  15, 14, 12, 10, 6, 4, 0;
  17, 16, 14, 12, 8, 6, 2, 0;
		

Crossrefs

Cf. A040976 (1st column).

Programs

  • PARI
    fn(n) = forprime(x=2,n, forprime(y=2,x,print1(x-y",")))
    
  • PARI
    T(n, k) = prime(n) - prime(k);
    tabl(nn) = for (n=1, nn, for (k=1, n, print1(T(n, k), ", ")); print); \\ Michel Marcus, Aug 08 2017

Extensions

Offset corrected by Michel Marcus, Aug 08 2017