login
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.
1
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,2
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.
EXAMPLE
Rows: {1}; {5,4}; {12,11,9}; ...
Triangle begins:
1
5 4
12 11 9
22 21 19 16
35 34 32 29 25
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 *)
PROG
(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
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.
Sequence in context: A298779 A131875 A095871 * A316671 A338157 A189235
KEYWORD
nonn,tabl,easy
AUTHOR
David Shane, Mar 29 2017
STATUS
approved