cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-2 of 2 results.

A306549 a(n) is the product of the positions of the zeros in the binary expansion of n (the most significant bit having position 1).

Original entry on oeis.org

1, 1, 2, 1, 6, 2, 3, 1, 24, 6, 8, 2, 12, 3, 4, 1, 120, 24, 30, 6, 40, 8, 10, 2, 60, 12, 15, 3, 20, 4, 5, 1, 720, 120, 144, 24, 180, 30, 36, 6, 240, 40, 48, 8, 60, 10, 12, 2, 360, 60, 72, 12, 90, 15, 18, 3, 120, 20, 24, 4, 30, 5, 6, 1, 5040, 720, 840, 120, 1008
Offset: 0

Views

Author

Rémy Sigrist, May 04 2019

Keywords

Comments

Apparently, the variant where the least significant bit has position 1 corresponds to A124773.

Examples

			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
		

Crossrefs

Programs

  • Mathematica
    A306549[n_] := Times @@ Flatten[Position[IntegerDigits[n, 2], 0]];
    Array[A306549, 100, 0] (* Paolo Xausa, Jun 01 2024 *)
  • 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

Formula

a(n) = A070939(n)! / A306286(n).
a(2*n) = a(n) * (1+A070939(n)).
a(2*n+1) = a(n).
a(2^k) = (k+1)! for any k >= 0.
a(2^k-1) = 1 for any k >= 0.
a(2^k-2) = k for any k >= 1.

A307218 Numbers x with k digits in base 2 (MSD(x)_2 = d_1, LSD(x)_2 = d_k) that are equal to the product of the positions of 1's (see examples and formula).

Original entry on oeis.org

1, 1350, 47520, 1995840, 59376240
Offset: 1

Views

Author

Paolo P. Lava, Mar 29 2019

Keywords

Comments

If 0's instead of 1's are considered, then the sequence starts with 2, 12, 504, ...
If the positions are counted with MSD(x)_2 = d_k and LSD(x)_2 = d_1 then the sequence starts with 1, 2, 6, 12, 576000, ... (see A161324).
Next value greater than 10^12. - Giovanni Resta, Mar 29 2019

Examples

			1350 in base 2 is 10101000110. The 1's are in positions 1, 3, 5, 9, 10 and 1*3*5*9*10 = 1350.
47520 in base 2 is 1011100110100000. The 1's are in positions 1, 3, 4, 5, 8, 9, 11 and 1*3*4*5*8*9*11 = 47520.
1995840 in base 2 is 111100111010001000000. The 1's are in positions 1, 2, 3, 4, 7, 8, 9, 11, 15 and 1*2*3*4*7*8*9*11*15 = 1995840.
		

Crossrefs

Programs

  • Maple
    P:=proc(q) local a,b,k,n; for n from 1 to q do
    a:=convert(n,base,2); b:=1; for k from 1 to nops(a) do
    if a[k]=1 then b:=b*(nops(a)-k+1); fi; od; if b=n then print(n);
    fi; od; end: P(10^9);
  • PARI
    b(n)=fromdigits(binary(n), 10); \\ A007088
    is(n)={k=1;v=digits(b(n));for(j=2,#v,if(v[j]==1,k=k*j));k==n;} \\ Jinyuan Wang, Mar 29 2019

Formula

Solutions of the equation x = Product_{j=1..k} ((1/2)*(1+j+(-1)^d_j*(1-j))), where d_j are the digits of x in base 2.
Showing 1-2 of 2 results.