OFFSET
1,2
COMMENTS
Odd numbers share a 1-bit (2^0) with all their divisors, hence this sequence deals with even numbers.
LINKS
FORMULA
a(n) <= A346878(n) with equality iff n is a power of 2.
EXAMPLE
For n = 6:
- the divisors of 12 are:
d bin(d) common bit?
-- ------ -----------
1 1 no
2 10 no
3 11 no
4 100 yes
6 110 yes
12 1100 yes
- hence a(6) = 1 + 2 + 3 = 6.
MATHEMATICA
a[n_] := DivisorSum[2n, #*Boole[BitAnd[#, 2n] == 0] &]; Array[a, 74]
PROG
(PARI) a(n) = sumdiv(2*n, d, if (bitand(2*n, d)==0, d, 0))
(Python)
from sympy import divisors as divs
def a(n): return sum(d for d in divs(2*n, generator=True) if (d>>1)&n == 0)
print([a(n) for n in range(1, 75)]) # Michael S. Branicky, Dec 15 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Dec 15 2022
STATUS
approved