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.

A328282 a(n) is the least k such that A175930(k) = n.

Original entry on oeis.org

1, 3, 2, 15, 6, 4, 5, 255, 30, 12, 13, 16, 9, 11, 10, 65535, 510, 60, 61, 48, 25, 27, 26, 256, 33, 19, 18, 47, 22, 20, 21, 4294967295, 131070, 1020, 1021, 240, 121, 123, 122, 768, 97, 51, 50, 111, 54, 52, 53, 65536, 513, 67, 66, 79, 38, 36, 37, 767, 94, 44, 45
Offset: 1

Views

Author

Rémy Sigrist, Oct 11 2019

Keywords

Comments

To compute a(n):
- the binary representation of n has k = A000120(n) one bits,
- the binary representation of a(n) has k runs of consecutive equal bits,
- the length of the i-th run in a(n) has length 2^z where z is the number of zeros immediately following the i-th one bit in the binary representation of n,
- this division into sections starting with ones in n or corresponding to a run in a(n) is materialized by slashes in the example section.

Examples

			The first terms, alongside the binary representation of n and of a(n) with peer sections separated by slashes, are:
    n   a(n)   bin(n)   bin(a(n))
    --  -----  -------  ----------------
     1      1        1                 1
     2      3       10                11
     3      2      1/1               1/0
     4     15      100              1111
     5      6     10/1              11/0
     6      4     1/10              1/00
     7      5    1/1/1             1/0/1
     8    255     1000          11111111
     9     30    100/1            1111/0
    10     12    10/10             11/00
    11     13   10/1/1            11/0/1
    12     16    1/100            1/0000
    13      9   1/10/1            1/00/1
    14     11   1/1/10            1/0/11
    15     10  1/1/1/1           1/0/1/0
    16  65535    10000  1111111111111111
		

Crossrefs

Programs

  • PARI
    a(n)={ my (r=[], l, v=0); while (n, r=concat(l=1+valuation(n,2), r); n \= 2^l); for (i=1, #r, v *= 2^2^(r[i]-1); if (i%2, v += 2^2^(r[i]-1)-1)); v }

Formula

a(n) <= 2^n-1 with equality iff n is a power of 2.
A005811(a(n)) = A000120(n).