OFFSET
1,3
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,3,-3,-3,3,1,-1).
FORMULA
a(n) = 2 * Sum_{i=1..floor((n-1)/2)} i^2 + (n-i)^2.
a(n) = 2 * A294286(n).
From Colin Barker, Oct 31 2017: (Start)
G.f.: 2*x^3*(5 + 5*x + 5*x^2 + x^3) / ((1 - x)^4*(1 + x)^3).
a(n) = n*(8*n^2 - 18*n + 4) / 12 for n even.
a(n) = n*(8*n^2 - 12*n + 4) / 12 for n odd.
a(n) = a(n-1) + 3*a(n-2) - 3*a(n-3) - 3*a(n-4) + 3*a(n-5) + a(n-6) - a(n-7) for n > 7.
(End)
a(n) = n*(2*n-3-(-1)^n)*(8*n-3+(-1)^n)/24. - Wesley Ivan Hurt, Dec 02 2023
EXAMPLE
a(14) = 1540; the rectangles are 1 X 13, 2 X 12, 3 X 11, 4 X 10, 5 X 9, 6 X 8 (7 X 7 is not considered since W < L). The sum of the areas of the squares on the sides of the rectangles is 2*1^2+2*13^2 + 2*2^2+2*12^2 + 2*3^2+2*11^2 + 2*4^2+2*10^2 + 2*5^2+2*9^2 + 2*6^2+2*8^2 = 340 + 296 + 260 + 232 + 212 + 200 = 1540.
MATHEMATICA
Table[2 Sum[i^2 + (n - i)^2, {i, Floor[(n-1)/2]}], {n, 40}]
PROG
(PARI) concat(vector(2), Vec(2*x^3*(5 + 5*x + 5*x^2 + x^3) / ((1 - x)^4*(1 + x)^3) + O(x^60))) \\ Colin Barker, Oct 31 2017
(PARI) a(n) = 2*sum(i=1, (n-1)\2, i^2 + (n-i)^2); \\ Michel Marcus, Nov 08 2017
(Magma) [n*(2*n-3-(-1)^n)*(8*n-3+(-1)^n)/24: n in [1..60]]; // Wesley Ivan Hurt, Dec 02 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Oct 31 2017
STATUS
approved