OFFSET
1,2
COMMENTS
Reading down the diagonal gives A002415.
LINKS
Joel B. Lewis, Jun 29 2007, Table of n, a(n) for n = 1..210
Problem solved on the Art of Problem Solving forum, Number of squares in a grid
FORMULA
T(n, k) = k*(k+1)*(k+2)*(2*n - k + 1)/12 (k <= n).
EXAMPLE
T(2, 2) = 6 because there are 6 squares all of whose vertices lie in a 3 X 3 lattice: four squares of side length 1, one square of side length 2 and one non-orthogonal square of side length the square root of 2.
Triangle begins:
1;
2, 6;
3, 10, 20;
4, 14, 30, 50;
5, 18, 40, 70, 105;
6, 22, 50, 90, 140, 196;
7, 26, 60, 110, 175, 252, 336;
...
PROG
(PARI) T(n, k) = binomial(k+2, 3)*(2*n - k + 1)/2 \\ Charles R Greathouse IV, Mar 08 2017
CROSSREFS
KEYWORD
AUTHOR
Joel B. Lewis, Jun 29 2007
STATUS
approved