A227872 Number of odious divisors (A000069) of n.
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
Links
- Peter J. C. Moses, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
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 *)
-
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
Formula
a(2^n) = n+1. - Bernard Schott, Jul 22 2022
a(n) = 1 iff n is in A093688. - Bernard Schott, Jul 23 2022
a(n) = Sum_{d|n} A010060(d). - Ridouane Oudra, Apr 12 2025
Extensions
More terms from Peter J. C. Moses, Oct 25 2013
Comments