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.

User: David Shane

David Shane's wiki page.

David Shane has authored 1 sequences.

A284551 Triangular array read by rows, demonstrating that the difference between a pentagonal number (left edge of triangle) and a square (right edge) is a triangular number.

Original entry on oeis.org

1, 5, 4, 12, 11, 9, 22, 21, 19, 16, 35, 34, 32, 29, 25, 51, 50, 48, 45, 41, 36, 70, 69, 67, 64, 60, 55, 49, 92, 91, 89, 86, 82, 77, 71, 64, 117, 116, 114, 111, 107, 102, 96, 89, 81, 145, 144, 142, 139, 135, 130, 124, 117, 109, 100, 176, 175, 173, 170, 166, 161, 155, 148, 140, 131, 121, 210, 209
Offset: 1

Author

David Shane, Mar 29 2017

Keywords

Examples

			Rows: {1}; {5,4}; {12,11,9}; ...
Triangle begins:
               1
            5     4
        12    11     9
     22    21    19    16
  35    34    32    29    25
		

Crossrefs

Cf. A049777, A049780, which have a similar layout based on subtracting triangular numbers of increasing value from the leftmost element of the row.
A051662 gives row sums.

Programs

  • Maple
    A284551 := proc(n,m)
        n*(3*n-1)-m*(m-1) ;
        %/2 ;
    end proc:
    seq(seq(A284551(n,m),m=1..n),n=1..15) ; # R. J. Mathar, Mar 30 2017
  • Mathematica
    T[n_,m_]:= Floor[n(3n - 1) - m(m - 1)]/2; Table[T[n, k], {n, 12}, {k, n}] // Flatten (* Indranil Ghosh, Mar 30 2017 *)
  • PARI
    T(n,m) = floor(n*(3*n - 1) - m*(m - 1))/2;
    for(n=1, 12, for(k=1, n, print1(T(n,k),", ");); print();); \\ Indranil Ghosh, Mar 30 2017
    
  • Python
    def T(n, m): return (n*(3*n - 1) - m*(m - 1))//2
    for n in range(1, 13):
        print([T(n,k) for k in range(1, n + 1)]) # Indranil Ghosh, Mar 30 2017

Formula

P(m,n) = (m(3m-1) - n(n-1))/2. Alternatively, P(n) - T(n-1) = S(n) where P(n) is a pentagonal number, T(n-1) is a triangular number, and S(n) is a square number.