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.

A175020 An integer n is included if n is the smallest positive integer with its particular multiset of run-lengths (of either 0 or 1 considered together) in its binary representation.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 8, 9, 10, 12, 15, 16, 17, 18, 19, 21, 24, 31, 32, 33, 34, 35, 36, 37, 42, 48, 51, 56, 63, 64, 65, 66, 67, 68, 69, 71, 73, 74, 76, 85, 96, 99, 112, 127, 128, 129, 130, 131, 132, 133, 135, 136, 137, 138, 140, 146, 147, 149, 170, 192, 195, 199, 204, 224
Offset: 1

Views

Author

Leroy Quet, Nov 03 2009

Keywords

Comments

This sequence gives a way to enumerate unrestricted partitions of a number. The number of terms of this sequence that are each >= 2^(k-1) and <= 2^k -1 is equal to the number of unrestricted partitions of k.
Equivalently, numbers in whose binary representation the runs of 1's are in increasing order of length, the runs of 0's are in decreasing order of length, and all runs of 0's are at least as long as any run of 1's. The position of [1^m] in the partitions of m will be P(m-1). It is the last partition in the list with a part of size 1; anything with a part of size 2 or more will start 100... in the binary representation, while this partition starts 101...; and any partition that does not have a part of size 1 will start 11.... Removing one part of size 1 from the partitions of size m that have such a part gives each partition of m-1 uniquely. This relationship is expressed by the second formula of A002865. - Franklin T. Adams-Watters, Nov 03 2009
A000975 is a subsequence. - Alford Arnold, Nov 09 2009

Examples

			9 in binary is 1001. The run lengths form the multiset (1,2,1). Since no positive integer < 9 has this same multiset of run lengths, then 9 is in this sequence. On the other hand, 23 in binary is 10111. The run-lengths are (1,1,3). But 17 (which is < 23) in binary is 10001, which has the run-lengths of (1,3,1). Since the multisets (1,1,3) and (1,3,1) are identical, then 23 is not in this sequence.
		

Crossrefs

Cf. A175021 (complement), A175022, A175023, A175024, A000975.

Programs

  • Maple
    runLSet := proc(n) option remember ; local bdg,lset,arl,p ; bdg := convert(n,base,2) ; lset := [] ; arl := -1 ; for p from 1 to nops(bdg) do if p = 1 then arl := 1 ; elif op(p,bdg) = op(p-1,bdg) then arl := arl+1 ; else if arl > 0 then lset := [arl,op(lset)] ; end if; arl := 1 ; end if; end do ; if arl > 0 then lset := [arl,op(lset)] ; end if; return lset ; end proc:
    isA175020 := proc(n) local thisLset,k ; thisLset := runLSet(n) ; for k from 1 to n-1 do if convert(runLSet(k),multiset) = convert(thisLset,multiset) then return false; end if; end do ; return true; end proc:
    for n from 1 to 300 do if isA175020(n) then printf("%d,",n) ; end if; end do;
    # R. J. Mathar, Feb 27 2010
  • Mathematica
    With[{s = Array[Sort@ Map[Length, Split@ IntegerDigits[#, 2]] &, 224]}, Values[PositionIndex@ s][[All, 1]]] (* Michael De Vlieger, Sep 03 2017 *)

Extensions

More terms from Alford Arnold, Nov 09 2009
Terms beyond 64 by R. J. Mathar, Feb 27 2010

A382250 Irregular 3-dimensional table, where layer n is an irregular 2D table with A000041(n) columns, each of which lists the n-bit binary numbers whose run lengths correspond to a given partition.

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 3, 2, 0, 1, 7, 2, 4, 6, 3, 5, 0, 1, 15, 2, 8, 14, 3, 7, 4, 6, 12, 5, 9, 11, 13, 10, 0, 1, 31, 2, 16, 30, 3, 15, 4, 6, 8, 14, 24, 28, 5, 17, 23, 29, 7, 9, 11, 13, 19, 25, 27, 10, 18, 20, 22, 26, 12, 21, 0, 1, 63, 2, 32, 62, 3, 31, 4, 6, 16, 30, 48, 60, 5, 33, 47, 61, 7, 15, 8, 14
Offset: 0

Views

Author

Ali Sada and M. F. Hasler, Mar 24 2025

Keywords

Comments

The n-th layer contains the 2^(n-1) numbers from 0 to 2^(n-1)-1, each of which corresponds, through the run lengths of the digits when written with n bits, uniquely to one of the 2^(n-1) compositions of n. (For example, 000 <=> 3, 001 <=> 2+1; 010 <=> 1+1+1.) The numbers are grouped together in columns which correspond to the distinct partitions of n, so there are A000041(n) of these, where A000041 are the partition numbers.
Numbers that will never be in a top row are listed in A175021 = 6, 11, 13, 14, 20, 22, 23, 25, 26, 27, 28, 29, 30, 38, .... All other numbers will eventually be in a fixed position in the top row of all large enough layers.

Examples

			The table starts as follows:
n = 0: There is A000041(0) = 1 partition of 0, the empty partition, which equals the
       run lengths of the empty sequence of digits of 0 written with 0 binary digits.
       So there is 1 column with just one number, 0:
       0
n = 1: Again there is A000041(1) = 1 partition of 1, so there is 1 column, which
       contains the number 0 written with n = 1 bits, so that run lengths are (1):
       0
n = 2: There are A000041(2) = 2 columns for the two partitions of 2; each column
       contains one number: 0 = 00 <=> partition (2), resp. 1 = 01 <=> (1,1):
       0  1
n = 3: There are A000041(3) = 3 columns for the three partitions of 3,
       corresponding to the 2^2 = 4 compositions which are the run lengths of
       0 = 000 <=> partition (3) in column 1,
       1 = 001 and 3 = 011 (partition 2+1 = 1+2) in column 2,
       and 2 = 010 (partition (1,1,1) or 1+1+1) in column 3:
       0  1  2
          3
n = 4: Here are A000041(4) = 5 columns for the five partitions of 4, corresponding
       to 2^3 = 8 compositions of 4 given as run lengths of the numbers 0, ..., 7
       written with 4 bits: Column 1 holds the number 0 = 0000 <=> partition (4),
       column 2 holds the numbers 1 = 0001 and 7 = 0111 <=> partition 3+1 = 1+3,
       column 3 holds 2 = 0010, 4 = 0100 and 6 = 0110 for 2+1+1 = 1+1+2 = 1+2+1,
       column 4 holds 3 = 0011 for 2+2, and column 5 holds 5 = 0101 for 1+1+1+1:
       0  1  2  3  5
          7  4
             6
n = 5: 0   1   2   3   4   5  10
          15   8   7   6   9
              14      12  11
                          13
n = 6: 0   1   2   3   4   5   7   9  10  12   21
          31  16  15   6  17      11  18
              30       8  23      13  20
                      14  29      19  22
                      24          25  26
                      28          27
		

Crossrefs

Cf. A000041 (partition numbers), A000079 (powers of 2), A007088 (binary numbers), A101211 and A318927 (run lengths of binary numbers).
The number of columns of length 1 in layer n is A000005(n).
Cf. A175021 (numbers never in the first row), A175020 (limit of the first rows without initial 0).

Programs

  • PARI
    {layer(n)=my(M=Map(), C=[], p, i); for(k=1, 2^max(n-1,0), mapisdefined(M, p=vecsort(A101211_row(2^n-k)), &i) || mapput(M, p, i=#C=concat(C,[[]])); C[i]=concat(C[i], k-1)); C}

Formula

If we denote by A(n, c, r) the r-th element of column number c in layer n, then
A(n, c, 1) = c-1 for 1 <= c <= min(n, 6); lim_{n -> oo} A(n, c+1, 1) = A175020(c).
A(n, 2, 2) = 2^(n-1) - 1 is the last element of column 2 for all n > 2.
A(n, 3, 2) = 2^(n-2), and A(n, 3, 3) = 2^(n-1) - 2 is the last element of column 3 for all n > 3.
A(n, 4, 2) = 2^(n-2) - 1 is the last element of column 4 for all n > 4.
Showing 1-2 of 2 results.