OFFSET
1,2
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..16384
FORMULA
a(n) = n for n = 1, 2 and 4.
a(n) = n + (tau(n) - 1) = n + 3 for squarefree semiprimes (A006881).
a(n) = 2 if n is prime. - Robert Israel, Dec 23 2018
EXAMPLE
For n = 6; a(6) = pod(1)/1 + pod(2)/2 + pod(3)/3 + pod(6)/6 = 1/1 + 2/2 + 3/3 + 36/6 = 9.
MAPLE
pod:= proc(n) convert(numtheory:-divisors(n), `*`) end proc:
f:= proc(n) local d; add(pod(d)/d, d = numtheory:-divisors(n)) end proc:
map(f, [$1..100]); # Robert Israel, Dec 23 2018
MATHEMATICA
Array[Sum[Apply[Times, Divisors@ d]/d, {d, Divisors@ #}] &, 59] (* Michael De Vlieger, Jan 19 2019 *)
PROG
(Magma) [&+[&*[c: c in Divisors(d)] / d: d in Divisors(n)]: n in [1..100]]
(PARI) a(n) = sumdiv(n, d, vecprod(divisors(d))/d); \\ Michel Marcus, Dec 23 2018
(Python)
from math import isqrt
from sympy import divisor_count, divisors
def A322671(n): return sum(isqrt(d)**(c-2) if (c:=divisor_count(d)) & 1 else d**(c//2-1) for d in divisors(n, generator=True)) # Chai Wah Wu, Jun 25 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Jaroslav Krizek, Dec 23 2018
STATUS
approved