login
A227872
Number of odious divisors (A000069) of n.
13
1, 2, 1, 3, 1, 2, 2, 4, 1, 2, 2, 3, 2, 4, 1, 5, 1, 2, 2, 3, 3, 4, 1, 4, 2, 4, 1, 6, 1, 2, 2, 6, 2, 2, 3, 3, 2, 4, 2, 4, 2, 6, 1, 6, 1, 2, 2, 5, 3, 4, 1, 6, 1, 2, 3, 8, 2, 2, 2, 3, 2, 4, 3, 7, 2, 4, 2, 3, 2, 6, 1, 4, 2, 4, 2, 6, 3, 4, 2, 5, 2, 4, 1, 9, 1, 2, 2
OFFSET
1,2
LINKS
FORMULA
a(n) + A356018(n) = A000005(n).
a(2^n) = n+1. - Bernard Schott, Jul 22 2022
a(n) = 1 iff n is in A093688. - Bernard Schott, Jul 23 2022
MAPLE
A227872 := proc(n)
option remember ;
local a, d ;
a := 0 ;
for d in numtheory[divisors](n) do
if not isA001969(d) then
a := a+1 ;
end if;
end do:
a ;
end proc:
seq(A227872(n), n=1..200) ; # R. J. Mathar, Aug 07 2022
MATHEMATICA
a[n_] := DivisorSum[n, 1 &, OddQ[DigitCount[#, 2, 1]] &]; Array[a, 100] (* Amiram Eldar, Jul 23 2022 *)
PROG
(PARI) a(n) = sumdiv(n, d, hammingweight(d) % 2); \\ Michel Marcus, Feb 06 2016
(PARI) isod(n) = hammingweight(n) % 2; \\ A000069
a(n) = my(v=valuation(n, 2)); n >>= v; sumdiv(n, d, isod(d)) * (v+1) \\ David A. Corneth, Jul 23 2022
(Python)
from sympy import divisors
def c(n): return bin(n).count("1")&1
def a(n): return sum(1 for d in divisors(n, generator=True) if c(d))
print([a(n) for n in range(1, 101)]) # Michael S. Branicky, Jul 23 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Vladimir Shevelev, Oct 25 2013
EXTENSIONS
More terms from Peter J. C. Moses, Oct 25 2013
STATUS
approved