# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a246601 Showing 1-1 of 1 %I A246601 #27 Dec 16 2022 09:00:14 %S A246601 1,2,4,4,6,8,8,8,10,12,12,16,14,16,24,16,18,20,20,24,22,24,24,32,26, %T A246601 28,40,32,30,48,32,32,34,36,36,40,38,40,43,48,42,44,44,48,60,48,48,64, %U A246601 50,52,72,56,54,80,61,64,58,60,60,96,62,64,104,64,66,68,68,72,70,72 %N A246601 Sum 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 A246601 Equivalently, the sum of the divisors d of n such that the bitwise OR of d and n is equal to n. - _Chai Wah Wu_, Sep 06 2014 %C A246601 Equivalently, the sum of the divisors d of n such that the bitwise AND of n and d is equal to d. - _Amiram Eldar_, Dec 15 2022 %H A246601 N. J. A. Sloane, Table of n, a(n) for n = 1..10000 %F A246601 a(2^i) = 2^i. %F A246601 a(odd prime p) = p+1. %F A246601 From _Amiram Eldar_, Dec 15 2022: (Start) %F A246601 a(2*n) = 2*a(n), and therefore a(m*2^k) = 2^k*a(m) for m odd and k>=0. %F A246601 a(2^n-1) = sigma(2^n-1) = A075708(n). (End) %e A246601 12 = 1100_2; only the divisors 4 = 0100_2 and 12 = 1100_2 satisfy the condition, so(12) = 4+12 = 16. %e A246601 15 = 1111_2; all divisors 1,3,5,15 satisfy the condition, so a(15)=24. %p A246601 with(numtheory); %p A246601 sd:=proc(n) local a,d,s,t,i,sw; %p A246601 s:=convert(n,base,2); %p A246601 a:=0; %p A246601 for d in divisors(n) do %p A246601 sw:=-1; %p A246601 t:=convert(d,base,2); %p A246601 for i from 1 to nops(t) do if t[i]>s[i] then sw:=1; fi; od: %p A246601 if sw<0 then a:=a+d; fi; %p A246601 od; %p A246601 a; %p A246601 end; %p A246601 [seq(sd(n),n=1..100)]; %t A246601 a[n_] := DivisorSum[n, #*Boole[BitOr[#, n] == n] &]; Array[a, 100] (* _Jean-François Alcover_, Dec 02 2015, adapted from PARI *) %o A246601 (Python) %o A246601 from sympy import divisors %o A246601 def A246601(n): %o A246601 ....return sum(d for d in divisors(n) if n|d == n) %o A246601 # _Chai Wah Wu_, Sep 06 2014 %o A246601 (PARI) a(n) = sumdiv(n, d, d*(bitor(n,d)==n)); \\ _Michel Marcus_, Sep 07 2014 %Y A246601 Cf. A000005, A000203, A075708, A246600. %K A246601 nonn,base %O A246601 1,2 %A A246601 _N. J. A. Sloane_, Sep 06 2014 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE