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-3 of 3 results.

A072464 Code word lengths for non-redundant MML code for positive integers.

Original entry on oeis.org

1, 3, 3, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13
Offset: 1

Views

Author

Michael Somos, Jun 19 2002

Keywords

Comments

Also the number of bits needed to write the universal code for an Elias omega coding. This seems to differ (by 1 bit) from the Elias omega coding used in A147814 and A147764. - Charles R Greathouse IV, Mar 26 2012

Examples

			Code words: 1, 010, 011, 000100, 000101, 000110, 000111, ...
		

Crossrefs

Cf. A147814, A147764, A255308 (first differences), A292046 (list of distinct values).

Programs

  • PARI
    a(n) = local(l); if( n<2, n>0, l = length( binary(n)); l + a(l-1))

A255309 Number of times log_2 can be applied to n until the result is either 1 or not a power of 2. Here log_2 means the base-2 logarithm.

Original entry on oeis.org

0, 0, 1, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
Offset: 0

Views

Author

Paul Boddington, Feb 20 2015

Keywords

Crossrefs

Cf. A000079 (2^n), A007814 (2-adic valuation of n), A209229, A255308.

Programs

  • PARI
    nbi(n) = {my(nb = 0); if ((ispower(n, ,&m) && (m==2)) || (n==2), return(nbi(valuation(n, 2))+1);); nb;}
    a(n) = { my(nb = 0); if ((ispower(n, ,&m) && (m==2)) || (n==2), return(nbi(valuation(n, 2))+1);); nb;} \\ Michel Marcus, Mar 11 2015; corrected Jun 13 2022
    
  • PARI
    A255309(n) = { my(k=0); while((n>1)&&!bitand(n,n-1),n = valuation(n,2); k++); (k); }; \\ Antti Karttunen, Sep 30 2018

Formula

a(n) = 1 + a(log_2(n)) if n is a power of 2 except 1, 0 otherwise.

Extensions

Extended up to a(128) by Antti Karttunen, Sep 30 2018

A293668 First differences of A292046.

Original entry on oeis.org

1, 2, 3, 1, 4, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 0

Views

Author

Andrey Zabolotskiy, Oct 14 2017

Keywords

Comments

a(n) is also the length of n-th run of consecutive integers in the complement of A292046, starting from the 1st run "4, 5".
This sequence is invariant under the following transform: subtract 1 from every term, eliminate zeros. Other sequences with this property include A001511 and other generalized ruler functions, A002260, A272729.

Crossrefs

Programs

  • PARI
    A293668(n) = { my(k=1); while(n && !bitand(n,n-1),n = valuation(n,2); k++); (k); }; \\ Antti Karttunen, Sep 30 2018

Formula

a(0) = 1, a(n) = A292046(n+1)-A292046(n) for n>0.
If n = 2^k, a(n) = a(k)+1; otherwise a(n) = 1.
a(n) = A255308(n) + 1.
a(n) = O(log*(n)), where log* is the iterated logarithm. More precisely, a(n) <= A230864(n+1)+1.
Showing 1-3 of 3 results.