A348915 a(n) = Sum_{d|n} d^(d mod 2).
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
Keywords
Examples
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.
Links
Programs
-
Maple
f:= proc(n) local d; add(d^(d mod 2), d = numtheory:-divisors(n)) end proc; map(f, [$1..100]); # Robert Israel, Jun 01 2025
-
Mathematica
a[n_] := DivisorSum[n, #^Mod[#, 2] &]; Array[a, 100] (* Amiram Eldar, Nov 04 2021 *)
-
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
Formula
a(p) = p+1 for odd primes p. - Wesley Ivan Hurt, Nov 28 2021
a(n) = A000203(n) if n is odd. - Robert Israel, Jun 01 2025
Comments