Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #89 Jun 01 2024 14:46:25
%S 1,1,1,2,1,3,2,6,1,4,3,12,2,8,6,24,1,5,4,20,3,15,12,60,2,10,8,40,6,30,
%T 24,120,1,6,5,30,4,24,20,120,3,18,15,90,12,72,60,360,2,12,10,60,8,48,
%U 40,240,6,36,30,180,24,144,120,720,1,7,6,42,5,35,30
%N a(n) is the product of the positions of the ones in the binary expansion of n (the most significant bit having position 1).
%C The variant where the least significant bit has position 1 corresponds to A096111 (with an appropriate offset).
%H Rémy Sigrist, <a href="/A306286/b306286.txt">Table of n, a(n) for n = 0..16384</a>
%F a(2*n) = a(n).
%F a(2^k) = 1 for any k >= 0.
%F a(2^k-1) = k! for any k >= 0.
%F a(2^k+1) = k+1 for any k >= 0.
%e The first terms, alongside the positions of ones and the binary representation of n, are:
%e n a(n) Pos. ones bin(n)
%e -- ---- --------- ------
%e 0 1 {} 0
%e 1 1 {1} 1
%e 2 1 {1} 10
%e 3 2 {1,2} 11
%e 4 1 {1} 100
%e 5 3 {1,3} 101
%e 6 2 {1,2} 110
%e 7 6 {1,2,3} 111
%e 8 1 {1} 1000
%e 9 4 {1,4} 1001
%e 10 3 {1,3} 1010
%e 11 12 {1,3,4} 1011
%e 12 2 {1,2} 1100
%e 13 8 {1,2,4} 1101
%e 14 6 {1,2,3} 1110
%e 15 24 {1,2,3,4} 1111
%e 16 1 {1} 10000
%t A306286[n_] := Times @@ Flatten[Position[IntegerDigits[n, 2], 1]];
%t Array[A306286, 100, 0] (* _Paolo Xausa_, Jun 01 2024 *)
%o (PARI) a(n) = my (b=binary(n)); prod(k=1, #b, if (b[k],k,1))
%o (PARI) a(n) = vecprod(Vec(select(x->(x==1), binary(n), 1))); \\ _Michel Marcus_, Jun 01 2024
%o (Python)
%o from math import prod
%o def a(n): return prod(i for i, bi in enumerate(bin(n)[2:], 1) if bi == "1")
%o print([a(n) for n in range(71)]) # _Michael S. Branicky_, Jun 01 2024
%Y Cf. A096111, A306549, A307218 (fixed points).
%K nonn,base,easy
%O 0,4
%A _Rémy Sigrist_, May 04 2019