OFFSET
0,3
COMMENTS
Apparently, the variant where the least significant bit has position 1 corresponds to A124773.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..16384
FORMULA
EXAMPLE
The first terms, alongside the positions of zeros and the binary representation of n, are:
n a(n) Pos.zeros bin(n)
-- ---- --------- ------
0 1 {1} 0
1 1 {} 1
2 2 {2} 10
3 1 {} 11
4 6 {2,3} 100
5 2 {2} 101
6 3 {3} 110
7 1 {} 111
8 24 {2,3,4} 1000
9 6 {2,3} 1001
10 8 {2,4} 1010
11 2 {2} 1011
12 12 {3,4} 1100
13 3 {3} 1101
14 4 {4} 1110
15 1 {} 1111
MATHEMATICA
A306549[n_] := Times @@ Flatten[Position[IntegerDigits[n, 2], 0]];
Array[A306549, 100, 0] (* Paolo Xausa, Jun 01 2024 *)
PROG
(PARI) a(n) = my (b=binary(n)); prod(k=1, #b, if (b[k]==0, k, 1))
(PARI) a(n) = vecprod(Vec(select(x->(x==0), binary(n), 1)));
(Python)
from math import prod
def a(n): return prod(i for i, bi in enumerate(bin(n)[2:], 1) if bi == "0")
print([a(n) for n in range(70)]) # Michael S. Branicky, Jun 01 2024
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Rémy Sigrist, May 04 2019
STATUS
approved