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.

A246600 Number of divisors d of n with property that the binary representation of d can be obtained from the binary representation of n by changing any number of 1's to 0's.

This page as a plain text file.
%I A246600 #54 Apr 18 2025 21:21:32
%S A246600 1,1,2,1,2,2,2,1,2,2,2,2,2,2,4,1,2,2,2,2,2,2,2,2,2,2,4,2,2,4,2,1,2,2,
%T A246600 2,2,2,2,3,2,2,2,2,2,4,2,2,2,2,2,4,2,2,4,3,2,2,2,2,4,2,2,6,1,2,2,2,2,
%U A246600 2,2,2,2,2,2,3,2,2,3,2,2,2,2,2,2,4,2,3,2,2,4,2
%N A246600 Number of divisors d of n with property that the binary representation of d can be obtained from the binary representation of n by changing any number of 1's to 0's.
%C A246600 Equivalently, the number of divisors d of n such that the bitwise OR of n and d is equal to n. - _Chai Wah Wu_, Sep 06 2014
%C A246600 Equivalently, the number of divisors d of n such that the bitwise AND of n and d is equal to d. - _Amiram Eldar_, Dec 15 2022
%C A246600 The sums of the first 10^k terms for k = 1, 2, ..., are 16, 224, 2580, 26920, 273407, 2745100, 27440305, 274127749, 2738936912, 27373288534, 273631055291, 2735755647065, ... . Conjecture: The asymptotic mean of this sequence is 1 + Sum_{k>=1} 1/(k*2^A000120(k)) = 2.7351180693... . - _Amiram Eldar_, Apr 07 2023
%H A246600 N. J. A. Sloane, <a href="/A246600/b246600.txt">Table of n, a(n) for n = 1..10000</a>
%F A246600 a(2^i) = 1.
%F A246600 a(odd prime) = 2.
%F A246600 a(n) <= 2^wt(n)-1, where wt(n) = A000120(n).
%F A246600 a(n) = Sum_{d|n} A047999(n,d), where A047999(n,d) = binomial(n,d) mod 2. - _Ridouane Oudra_, May 03 2019
%F A246600 From _Amiram Eldar_, Dec 15 2022: (Start)
%F A246600 a(2*n) = a(n), and therefore a(m*2^k) = a(m) for m odd and k>=0.
%F A246600 a(2^n-1) = A000005(2^n-1) = A046801(n). (End)
%e A246600 12 = 1100_2; only the divisors 4 = 0100_2 and 12 = 1100_2 satisfy the condition, so(12)=2.
%e A246600 15 = 1111_2; all divisors 1,3,5,15 satisfy the condition, so a(15)=4.
%p A246600 A246600:=proc(n)
%p A246600     local a, d, s, t, i, sw;
%p A246600     a:=0;
%p A246600     s:=convert(n, base, 2);
%p A246600     for d in numtheory[divisors](n) do
%p A246600         sw:= false;
%p A246600         t:=convert(d, base, 2);
%p A246600         for i from 1 to nops(t) do
%p A246600             if t[i]>s[i] then
%p A246600                 sw:= true;
%p A246600             fi;
%p A246600         od:
%p A246600         if not sw then
%p A246600             a:=a+1;
%p A246600         fi;
%p A246600     od;
%p A246600     a;
%p A246600 end;
%p A246600 seq(A246600(n), n=1..100);
%t A246600 a[n_] := DivisorSum[n, Boole[BitOr[#, n] == n]&]; Array[a, 100] (* _Jean-François Alcover_, Dec 02 2015, adapted from PARI *)
%o A246600 (Python)
%o A246600 from sympy import divisors
%o A246600 def A246600(n):
%o A246600     return sum(1 for d in divisors(n) if n|d == n)
%o A246600 # _Chai Wah Wu_, Sep 06 2014
%o A246600 (PARI) a(n)=sumdiv(n,d,bitor(d,n)==n) \\ _Charles R Greathouse IV_, Sep 29 2014
%Y A246600 Cf. A000005, A000120, A046801, A246601, A047999.
%K A246600 nonn,base
%O A246600 1,3
%A A246600 _N. J. A. Sloane_, Sep 06 2014