login
A348915
a(n) = Sum_{d|n} d^(d mod 2).
4
1, 2, 4, 3, 6, 6, 8, 4, 13, 8, 12, 8, 14, 10, 24, 5, 18, 16, 20, 10, 32, 14, 24, 10, 31, 16, 40, 12, 30, 28, 32, 6, 48, 20, 48, 19, 38, 22, 56, 12, 42, 36, 44, 16, 78, 26, 48, 12, 57, 34, 72, 18, 54, 44, 72, 14, 80, 32, 60, 32, 62, 34, 104, 7, 84, 52, 68, 22, 96, 52, 72, 22, 74
OFFSET
1,2
COMMENTS
For each divisor d of n, add d if d is odd, otherwise add 1.
FORMULA
a(n) = A000593(n) + A183063(n).
a(n) = A065608(2n) - 2*A065608(n).
a(p) = p+1 for odd primes p. - Wesley Ivan Hurt, Nov 28 2021
a(n) = A000203(A000265(n))+A000005(A000265(n))*A007814(n). - Chai Wah Wu, Jul 16 2022
EXAMPLE
For n = 12, the divisors of 12 are 1, 2, 3, 4, 6, 12 with corresponding summands 1, 1, 3, 1, 1, 1, respectively. The sum is then a(12) = 1 + 1 + 3 + 1 + 1 + 1 = 8.
MATHEMATICA
a[n_] := DivisorSum[n, #^Mod[#, 2] &]; Array[a, 100] (* Amiram Eldar, Nov 04 2021 *)
PROG
(PARI) a(n) = sumdiv(n, d, if (d%2, d, 1)); \\ Michel Marcus, Nov 04 2021
(Python)
from math import prod
from sympy import factorint
def A348915(n):
f = factorint(n>>(m:=(~n&n-1).bit_length())).items()
d = prod(e+1 for p, e in f)
s = prod((p**(e+1)-1)//(p-1) for p, e in f)
return s+d*m # Chai Wah Wu, Jul 16 2022
CROSSREFS
Cf. A000005 (tau), A000203 (sigma), A000593, A065608, A183063.
Sequence in context: A309131 A162953 A235451 * A039819 A242424 A232271
KEYWORD
nonn
AUTHOR
Wesley Ivan Hurt, Nov 03 2021
STATUS
approved