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.
%I A284551 #39 Jun 13 2025 22:43:32 %S A284551 1,5,4,12,11,9,22,21,19,16,35,34,32,29,25,51,50,48,45,41,36,70,69,67, %T A284551 64,60,55,49,92,91,89,86,82,77,71,64,117,116,114,111,107,102,96,89,81, %U A284551 145,144,142,139,135,130,124,117,109,100,176,175,173,170,166,161,155,148,140,131,121,210,209 %N 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. %F A284551 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. %e A284551 Rows: {1}; {5,4}; {12,11,9}; ... %e A284551 Triangle begins: %e A284551 1 %e A284551 5 4 %e A284551 12 11 9 %e A284551 22 21 19 16 %e A284551 35 34 32 29 25 %p A284551 A284551 := proc(n,m) %p A284551 n*(3*n-1)-m*(m-1) ; %p A284551 %/2 ; %p A284551 end proc: %p A284551 seq(seq(A284551(n,m),m=1..n),n=1..15) ; # _R. J. Mathar_, Mar 30 2017 %t A284551 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 *) %o A284551 (PARI) T(n,m) = floor(n*(3*n - 1) - m*(m - 1))/2; %o A284551 for(n=1, 12, for(k=1, n, print1(T(n,k),", ");); print();); \\ _Indranil Ghosh_, Mar 30 2017 %o A284551 (Python) %o A284551 def T(n, m): return (n*(3*n - 1) - m*(m - 1))//2 %o A284551 for n in range(1, 13): %o A284551 print([T(n,k) for k in range(1, n + 1)]) # _Indranil Ghosh_, Mar 30 2017 %Y A284551 Cf. A049777, A049780, which have a similar layout based on subtracting triangular numbers of increasing value from the leftmost element of the row. %Y A284551 A051662 gives row sums. %K A284551 nonn,tabl,easy %O A284551 1,2 %A A284551 _David Shane_, Mar 29 2017