OFFSET
0,2
COMMENTS
This sequence is the sum of the number of squares with horizontal/vertical sides (whose length is a positive integer), which is equal to Sum_{j=1..n} j^2 = (n*(n + 1)*(2*n + 1))/6, and the number of squares with diagonal sides (whose length is a multiple of sqrt(2)/2), which is Sum_{j=1..n} (A111746(n - 1)) = floor((n*(4*n^2 - 1))/6). - Marco Ripà, Jan 14 2024
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (3,-2,-2,3,-1).
FORMULA
a(n) = n^3 + n^2/2 - 1/4 + (1/4)*(-1)^n.
a(n) = 3*a(n-1) - 2*a(n-2) - 2*a(n-3) + 3*a(n-4) - a(n-5) for n > 4. - Colin Barker, May 28 2015
G.f.: (x^3 + 3*x^2 + 7*x + 1) / ((x-1)^4*(x+1)). - Colin Barker, May 28 2015
From Marco Ripà, Jan 14 2024: (Start)
a(n) = floor(n^3 + n^2/2). (End)
MAPLE
seq(n^3+n^2/2-1/4+1/4*(-1)^n, n=1..65);
PROG
(PARI) Vec((x^3+3*x^2+7*x+1) / ((x-1)^4*(x+1)) + O(x^100)) \\ Colin Barker, May 28 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Floor van Lamoen, Nov 16 2005
STATUS
approved