|
|
A333463
|
|
a(n) = Sum_{k=1..n} floor(n/k) * gcd(n,k).
|
|
2
|
|
|
1, 4, 7, 13, 14, 27, 22, 38, 39, 53, 39, 85, 49, 81, 93, 106, 68, 143, 78, 165, 144, 143, 98, 243, 147, 176, 189, 252, 131, 338, 143, 281, 251, 243, 279, 440, 178, 278, 308, 470, 200, 514, 212, 438, 488, 350, 234, 660, 339, 522, 427, 538, 271, 670, 487, 714, 489, 462, 307, 1028
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
FORMULA
|
a(n) = Sum_{d|n} phi(n/d) * A006218(d).
a(n) = Sum_{k=1..n} Sum_{d|k} gcd(n,d).
|
|
MATHEMATICA
|
Table[Sum[Floor[n/k] GCD[n, k], {k, 1, n}], {n, 1, 60}]
Table[Sum[EulerPhi[n/d] Sum[DivisorSigma[0, k], {k, 1, d}], {d, Divisors[n]}], {n, 1, 60}]
|
|
PROG
|
(PARI) a(n) = sum(k=1, n, (n\k)*gcd(n, k)); \\ Michel Marcus, Mar 23 2020
(Python)
from math import isqrt
from sympy import divisors, totient
def A333463(n): return sum((2*sum(d//k for k in range(1, isqrt(d)+1))-isqrt(d)**2)*totient(n//d) for d in divisors(n, generator=True)) # Chai Wah Wu, Oct 07 2021
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|