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
KEYWORD
AUTHOR
David Shane, Mar 29 2017
STATUS
approved