OFFSET
1,3
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (5,-10,10,-5,1).
FORMULA
a(n) = n^2*(n^2 - 1)/12 - (n - 1)^2.
From Colin Barker, Oct 06 2019: (Start)
G.f.: x^3*(2 - x)*(1 + x) / (1 - x)^5.
a(n) = 5*a(n-1) - 10*a(n-2) + 10*a(n-3) - 5*a(n-4) + a(n-5) for n>5.
a(n) = (-12 + 24*n - 13*n^2 + n^4) / 12.
(End)
E.g.f.: 1 + (1/12)*exp(x)*(-12 + 12*x - 6*x^2 + 6*x^3 + x^4). - Stefano Spezia, Oct 06 2019
EXAMPLE
On the 4 X 4 grid we have: four 2 X 2 squares, four sqrt(2) X sqrt(2) squares, two sqrt(5) X sqrt(5) squares, and one 3 X 3 square. Hence, a(4) = 11.
MATHEMATICA
Table[(n^4 - n^2)/12 - (n - 1)^2, {n, 1, 41}]
LinearRecurrence[{5, -10, 10, -5, 1}, {0, 0, 2, 11, 34}, 50] (* Harvey P. Dale, Aug 18 2024 *)
PROG
(PARI) a(n) = n^2*(n^2 - 1)/12 - (n - 1)^2; \\ Michel Marcus, Oct 06 2019
(PARI) concat([0, 0], Vec(x^3*(2 - x)*(1 + x) / (1 - x)^5 + O(x^40))) \\ Colin Barker, Oct 06 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Derek J. Graves, Oct 05 2019, on behalf of his 2019-20 Geometry class
STATUS
approved