OFFSET
1,3
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
Luc Rousseau, Diagram illustrating a(10)=19.
FORMULA
a(1) = 0.
a(p) = (p-1)^2 for p a prime number.
a(p^k) = (p-1)^2*k*p^(k-1) for p^k a prime power.
a(p*q) = 2*(p-1)^2*q + (q-p)^2 for p and q primes (p < q).
a(n) = (n/2 - 1)^2 + 3 if n=2*p with p a prime greater than 2.
a(n) = (n/p + F(p-1))^2 + p^2 - F(p-1)^2 if n = p*q, p < q primes; where F denotes the Fibonacci polynomial, F(x) = x^2 - x - 1 (see A165900).
For more complex factorization patterns of n, the formula depends on the factorization pattern of the sequence of divisors of n (see A191743 or A290110), e.g.:
a(p^2*q) = 4*p*q*(p-1)^2 + (q-p^2)^2 if 1 < p < p^2 < q < p*q < p^2*q,
but
a(p^2*q) = 2*p*q*(p-1)^2 + 2*p*(q-p)^2 + (p^2-q)^2 if 1 < p < q < p^2 < p*q < p^2*q.
a(n) = Sum_{i=1..tau(n)-1} (d_[tau(n)-i+1] - d_[tau(n)-i])*(d_[i+1] - d_[i]), where {d_i}, i=1..tau(n) is the increasing sequence of divisors of n. - Ridouane Oudra, Oct 17 2021
EXAMPLE
The divisors of n=12 are {1, 2, 3, 4, 6, 12}. The widths of the rectangles from the definition are obtained by difference: {1, 1, 1, 2, 6}. By symmetry, their heights are the same, but in reverse order: {6, 2, 1, 1, 1}. The sought total area is the sum of products width*height of each rectangle, in other words it is the dot product 1*6 + 1*2 + 1*1 + 2*1 + 6*1. Result: 17. So, a(12)=17.
MATHEMATICA
a[n_] := Module[{x = Differences[Divisors[n]]}, Plus @@ (x*Reverse[x])];
Table[a[n], {n, 1, 55}]
PROG
(PARI) arect(n, d, D) = (D-d)*(n/d - n/D);
a(n) = my(vd = divisors(n)); sum(k=1, #vd-1, arect(n, vd[k], vd[k+1])); \\ Michel Marcus, Oct 28 2018
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Luc Rousseau, Sep 09 2018
STATUS
approved