OFFSET
1,3
COMMENTS
Equally, the 2-adic valuation of A000593(n), the sum of odd divisors of n.
Proof for the given additive formula: It's easy to see that for all powers of 2 and all even powers of odd primes the result is zero. Thus assuming p is an odd prime, factorize sigma(p^(2e-1)) = (1 + p + p^2 + ... + p^(2e-1)) as (1+p)*(1 + u + u^2 + u^3 + ... + u^(e-1)), where u=p^2. Note that u [and its powers] are always of the form 4k+1, thus the 2-adic valuation of that sum is A007814(e) [see my Aug 15 2020 comment there] which when added to the 2-adic valuation of 1+p then gives the 2-adic valuation for whole sigma(p^(2e-1)).
LINKS
FORMULA
MATHEMATICA
a[n_] := IntegerExponent[DivisorSigma[1, n], 2]; Array[a, 100] (* Amiram Eldar, Jul 04 2022 *)
PROG
(PARI) A336937(n) = valuation(sigma(n), 2);
(PARI)
A007814(n) = valuation(n, 2);
A336937(n) = { my(f=factor(n)); sum(i=1, #f~, (f[i, 1]%2) * (f[i, 2]%2) * (A007814(1+f[i, 1])+A007814(1+f[i, 2])-1)); };
(Python)
from sympy import divisor_sigma
def A336937(n): return (~(m:=int(divisor_sigma(n))) & m-1).bit_length() # Chai Wah Wu, Jul 01 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Aug 12 2020
STATUS
approved