login
A397270
a(n) = (2*n-3-(-1)^n)*(32*n^2-9*n+7*n*(-1)^n)/96.
2
0, 0, 0, 10, 21, 60, 95, 182, 254, 408, 530, 770, 955, 1300, 1561, 2030, 2380, 2992, 3444, 4218, 4785, 5740, 6435, 7590, 8426, 9800, 10790, 12402, 13559, 15428, 16765, 18910, 20440, 22880, 24616, 27370, 29325, 32412, 34599, 38038, 40470, 44280, 46970, 51170, 54131, 58740, 61985, 67022, 70564, 76048
OFFSET
0,4
COMMENTS
Sum of the areas of all composite rectangles formed by taking each of the distinct nonsquare L X W integer-sided rectangles with semiperimeter n = L + W, and gluing L X L squares to their lengths (see example).
FORMULA
G.f.: x^3*(10+11*x+9*x^2+2*x^3)/((-1+x)^4*(1+x)^3).
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).
a(n) = 2*n^2*t-t*(t+1)*(9*n-2*t-1)/6, where t = floor((n-1)/2).
a(n) = Sum_{k=1..floor((n-1)/2)} (n-k) * (2*n-k).
E.g.f.: x*(x*(15 + 16*x)*cosh(x) - (15 - 24*x - 16*x^2)*sinh(x))/24. - Stefano Spezia, Jun 20 2026
a(2*n) = n*(n-1)*(32*n-1)/6, a(2*n+1) = 2*n*(2*n+1)*(4*n+1)/3. - Wesley Ivan Hurt, Jun 24 2026
EXAMPLE
For n = 8, the L X W rectangles with semiperimeter 8, including the squares on their lengths are:
.
7 1 7
_____________ _ _____________
| | | |
| | | |
| | | |
7 | | | | 7
| | | |
| | | |
|_____________|_|_____________|
7 1 7
.
6 2 6
___________ ___ ___________
| | | |
| | | |
6 | | | | 6
| | | |
| | | |
|___________|___|___________|
6 2 6
.
5 3 5
_________ _____ _________
| | | |
| | | |
5 | | | | 5
| | | |
|_________|_____|_________|
5 3 5
.
The sum of the composite areas = 105 + 84 + 65 = 254.
MATHEMATICA
Table[(2*n - 3 - (-1)^n)*(32*n^2 - 9*n + 7*n*(-1)^n)/96, {n, 0, 100}]
(* Alternative: *)
CoefficientList[Series[x^3*(10 + 11*x + 9*x^2 + 2*x^3)/((-1 + x)^4*(1 + x)^3), {x, 0, 100}], x]
PROG
(Magma) [(2*n-3-(-1)^n)*(32*n^2-9*n+7*n*(-1)^n)/96: n in [0..100]];
(Python)
def A397270(n): return n**2*(u:=n-1&-2)-(t:=n-1>>1)*(t+1)*(9*n-u-1)//6 # Chai Wah Wu, Jun 20 2026
CROSSREFS
Cf. A395421 (perimeters).
Sequence in context: A231966 A156592 A045973 * A095679 A095192 A356761
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Jun 19 2026
STATUS
approved