OFFSET
1,1
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = 2*n + Sum_{d|n} d*phi(d). - Vladeta Jovovic, Aug 27 2003
MATHEMATICA
f[p_, e_] := (p^(2*e+1)+1)/(p+1); a[1] = 3; a[n_] := 2*n + Times @@ (f @@@ FactorInteger[n]); Array[a, 50] (* Amiram Eldar, Jul 31 2019 *)
PROG
(Python)
from sympy import factorint, prod
a = lambda n: 2*n + prod((p**(2*e+1)+1)//(p+1) for p, e in factorint(n).items()) # Darío Clavijo, Feb 15 2024
(PARI) a(n) = 2*n + sumdivmult(n, d, d*eulerphi(d)); \\ Michel Marcus, Feb 16 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Yuval Dekel (dekelyuval(AT)hotmail.com), Aug 25 2003
EXTENSIONS
More terms from Vladeta Jovovic, Aug 27 2003
STATUS
approved