login
A334628
Total area of all distinct rectangles whose length and width are relatively prime and L + W = n.
1
0, 1, 2, 3, 10, 5, 28, 22, 42, 30, 110, 46, 182, 91, 140, 172, 408, 159, 570, 260, 420, 385, 1012, 380, 1050, 650, 1098, 770, 2030, 620, 2480, 1368, 1760, 1496, 2380, 1290, 4218, 2109, 2964, 2120, 5740, 1806, 6622, 3190, 4020, 3795, 8648, 3064, 8428, 4150, 6800, 5356, 12402
OFFSET
1,3
COMMENTS
Sum of the products of the parts in each partition of n into two relatively prime parts.
LINKS
FORMULA
a(n) = Sum_{i=1..floor(n/2)} [gcd(i,n-i) = 1] * i * (n-i), where [ ] is the Iverson bracket.
a(n) = n*A066840(n) - A295574(n). For n != 2, a(n) = n*(n*A000010(n)-A023900(n))/12 = (n*A023896(n)-A053818(n))/2. - Chai Wah Wu, Apr 28 2026
For n > 2, a(n) = (A000010(n)/12)*(n^2-A062953(n)). - Jamie Morken, May 25 2026
MATHEMATICA
Table[Sum[i*(n - i) KroneckerDelta[GCD[i, n - i], 1], {i, Floor[n/2]}], {n, 60}]
PROG
(Python)
from math import prod
from sympy import primefactors
def A334628(n):
ps = primefactors(n)
return (n==2)+n*(n**2*(k:=prod(p-1 for p in ps))//prod(ps)+(k if len(ps)&1 else -k))//12 # Chai Wah Wu, Apr 28 2026
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Sep 09 2020
STATUS
approved