OFFSET
1,2
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..10000
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
Ilya Gutkovskiy, Mar 22 2020
STATUS
approved