A096948 Triangular table read by rows: T(n,m) = number of rectangles found in an n X m rectangle built from 1 X 1 squares, 1 <= m <= n.
1, 3, 9, 6, 18, 36, 10, 30, 60, 100, 15, 45, 90, 150, 225, 21, 63, 126, 210, 315, 441, 28, 84, 168, 280, 420, 588, 784, 36, 108, 216, 360, 540, 756, 1008, 1296, 45, 135, 270, 450, 675, 945, 1260, 1620, 2025, 55, 165, 330, 550, 825, 1155, 1540, 1980, 2475, 3025
Offset: 1
Examples
T(2,2) = 9 because in a 2 X 2 square there are four 1 X 1 squares, two 1 X 2 rectangles, two 2 X 1 rectangles and one 2 X 2 square: 4 + 2 + 2 + 1 =9. T(3,2) = 18 = t(3)*t(2) because in a 3 X 2 rectangle there are six 1 X 1 squares, three 1 X 2 rectangles, four 2 X 1 rectangles, two 3 X 1 rectangles, two 2 X 2 squares and one 3 X 2 rectangle: 6 + 3 + 4 + 2 + 2 + 1 = 9 + 9 = 18. Triangle begins: 1, 3, 9, 6, 18, 36, 10, 30, 60, 100, 15, 45, 90, 150, 225, 21, 63, 126, 210, 315, 441, 28, 84, 168, 280, 420, 588, 784, 36, 108, 216, 360, 540, 756,1008,1296, 45, 135, 270, 450, 675, 945,1260,1620,2025, 55, 165, 330, 550, 825,1155,1540,1980,2475,3025, (...)
Links
- Paolo Xausa, Table of n, a(n) for n = 1..11325 (rows 1..150 of triangle, flattened).
- Steve Chow, Math for fun, how many rectangles?, blackpenredpen on YouTube, Apr 14 2018.
- Wolfdieter Lang, First 10 rows.
Programs
-
Mathematica
Table[n*(n+1)*m*(m+1)/4, {n, 10}, {m, n}] (* Paolo Xausa, Feb 25 2025 *)
-
PARI
T(n,m)=if(m>n,0,n*(n+1)*m*(m+1)/4) \\ Charles R Greathouse IV, Dec 14 2015
Formula
T(n, m) = t(n)*t(m) if n>=m else 0, with the triangular numbers t(n):= A000217(n), n>=1.
G.f. for column m (without leading zeros): t(m)*(x/(1-x)^3 - Sum_{k=0..m-1} t(k)*x^k)/x^m, m>=1.
Extensions
Name edited by M. F. Hasler, Oct 22 2020
Comments