|
|
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.
|
|
2
|
|
|
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, 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, 2, 2, 2, 2, 2, 2, 3, 2, 2, 3, 2, 2, 2, 2, 2, 2, 4, 2, 3, 2, 2, 4, 2
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
COMMENTS
|
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
|
|
LINKS
|
N. J. A. Sloane, Table of n, a(n) for n = 1..10000
|
|
FORMULA
|
a(2^i) = 1.
a(odd prime) = 2.
a(n) <= 2^wt(n)-1, where wt(n) = A000120(n).
a(n) = Sum_{d|n} (binomial(n,d) mod 2). - Ridouane Oudra, May 03 2019
|
|
EXAMPLE
|
12 = 1100_2; only the divisors 4 = 0100_2 and 12 = 1100_2 satisfy the condition, so(12)=2.
15 = 1111_2; all divisors 1,3,5,15 satisfy the condition, so a(15)=4.
|
|
MAPLE
|
with(numtheory);
sd:=proc(n) local a, d, s, t, i, sw;
s:=convert(n, base, 2);
a:=0;
for d in divisors(n) do
sw:=-1;
t:=convert(d, base, 2);
for i from 1 to nops(t) do if t[i]>s[i] then sw:=1; fi; od:
if sw<0 then a:=a+1; fi;
od;
a;
end;
[seq(sd(n), n=1..100)];
|
|
MATHEMATICA
|
a[n_] := DivisorSum[n, Boole[BitOr[#, n] == n]&]; Array[a, 100] (* Jean-François Alcover, Dec 02 2015, adapted from PARI *)
|
|
PROG
|
(Python)
from sympy import divisors
def A246600(n):
....return sum(1 for d in divisors(n) if n|d == n)
# Chai Wah Wu, Sep 06 2014
(PARI) a(n)=sumdiv(n, d, bitor(d, n)==n) \\ Charles R Greathouse IV, Sep 29 2014
|
|
CROSSREFS
|
Cf. A000005, A000120, A246601.
Sequence in context: A254315 A080942 A099812 * A068068 A193523 A092505
Adjacent sequences: A246597 A246598 A246599 * A246601 A246602 A246603
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
N. J. A. Sloane, Sep 06 2014
|
|
STATUS
|
approved
|
|
|
|