OFFSET
2,3
COMMENTS
We count all squares whose vertices are among the points; the sides of the squares need not be horizontal or vertical.
REFERENCES
Ian Stewart, How To Cut A Cake: and Other Mathematical Conundrums, Chap. 7.
LINKS
Index entries for linear recurrences with constant coefficients, signature (5,-10,10,-5,1).
FORMULA
a(n) = (n^4 - n^2 - 48*n + 84)/12.
G.f.: x^3*(1+6*x-8*x^2+3*x^3)/(1-x)^5. [Colin Barker, May 21 2012]
EXAMPLE
So for n=3 we have 5 points:
.....O
....OOO
.....O
The only square is formed by the 4 outer points, agreeing with a(3)=1.
For n=4 we have 12 points:
.....OO
....OOOO
....OOOO
.....OO
There are 5 unit squares, 4 tilted ones with sides sqrt(2) and 2 tilted ones with sides sqrt(5), agreeing with a(4)=11.
MATHEMATICA
Drop[CoefficientList[Series[x^3(1+6x-8x^2+3x^3)/(1-x)^5, {x, 0, 50}], x], 2] (* or *) LinearRecurrence[{5, -10, 10, -5, 1}, {0, 1, 11, 37, 88}, 50] (* Harvey P. Dale, Apr 16 2022 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Joshua Zucker, Dec 18 2006
EXTENSIONS
Additional comments from Dean Hickerson, Dec 18 2006
STATUS
approved