cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A227872 Number of odious divisors (A000069) of n.

This page as a plain text file.
%I A227872 #51 Apr 13 2025 14:56:04
%S A227872 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,
%T A227872 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,
%U A227872 2,6,1,4,2,4,2,6,3,4,2,5,2,4,1,9,1,2,2
%N A227872 Number of odious divisors (A000069) of n.
%H A227872 Peter J. C. Moses, <a href="/A227872/b227872.txt">Table of n, a(n) for n = 1..10000</a>
%F A227872 a(n) + A356018(n) = A000005(n).
%F A227872 a(2^n) = n+1. - _Bernard Schott_, Jul 22 2022
%F A227872 a(n) = 1 iff n is in A093688. - _Bernard Schott_, Jul 23 2022
%F A227872 a(n) = Sum_{d|n} A010060(d). - _Ridouane Oudra_, Apr 12 2025
%p A227872 A227872 := proc(n)
%p A227872     option remember ;
%p A227872     local a,d ;
%p A227872     a := 0 ;
%p A227872     for d in numtheory[divisors](n) do
%p A227872         if not isA001969(d) then
%p A227872             a := a+1 ;
%p A227872         end if;
%p A227872     end do:
%p A227872     a ;
%p A227872 end proc:
%p A227872 seq(A227872(n),n=1..200) ; # _R. J. Mathar_, Aug 07 2022
%t A227872 a[n_] := DivisorSum[n, 1 &, OddQ[DigitCount[#, 2, 1]] &]; Array[a, 100] (* _Amiram Eldar_, Jul 23 2022 *)
%o A227872 (PARI) a(n) = sumdiv(n, d, hammingweight(d) % 2); \\ _Michel Marcus_, Feb 06 2016
%o A227872 (PARI) isod(n) = hammingweight(n) % 2; \\ A000069
%o A227872 a(n) = my(v=valuation(n, 2)); n >>= v; sumdiv(n,d,isod(d)) * (v+1) \\ _David A. Corneth_, Jul 23 2022
%o A227872 (Python)
%o A227872 from sympy import divisors
%o A227872 def c(n): return bin(n).count("1")&1
%o A227872 def a(n): return sum(1 for d in divisors(n, generator=True) if c(d))
%o A227872 print([a(n) for n in range(1, 101)]) # _Michael S. Branicky_, Jul 23 2022
%Y A227872 Cf. A000005, A000069, A093688, A093696, A129771, A330289, A355968, A355969, A227873 (sum odious divs.).
%Y A227872 Cf. A010060.
%K A227872 nonn,base
%O A227872 1,2
%A A227872 _Vladimir Shevelev_, Oct 25 2013
%E A227872 More terms from _Peter J. C. Moses_, Oct 25 2013