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

A175022 a(n) = the number of runs (those of 0 and of 1 considered together) in the binary representation of A175020(n).

Original entry on oeis.org

1, 2, 1, 2, 3, 1, 2, 3, 4, 2, 1, 2, 3, 4, 3, 5, 2, 1, 2, 3, 4, 3, 4, 5, 6, 2, 3, 2, 1, 2, 3, 4, 3, 4, 5, 3, 5, 6, 4, 7, 2, 3, 2, 1, 2, 3, 4, 3, 4, 5, 3, 4, 5, 6, 4, 6, 5, 7, 8, 2, 3, 3, 4, 2, 2, 1, 2, 3, 4, 3, 4, 5, 3, 4, 5, 6, 4, 3, 5, 6, 5, 7, 4, 6, 7, 8, 5, 9, 2, 3, 3, 4, 2, 3, 2, 1, 2, 3, 4, 3, 4, 5, 3, 4, 5
Offset: 1

Views

Author

Leroy Quet, Nov 03 2009

Keywords

Comments

a(n) gives the number of terms in row n of irregular tables A175023 and A175024.

Crossrefs

Programs

  • Mathematica
    With[{s = Array[Sort@ Map[Length, Split@ IntegerDigits[#, 2]] &, 265]}, Map[Length@ Split@ IntegerDigits[#, 2] &, Values[PositionIndex@ s][[All, 1]] ]] (* Michael De Vlieger, Sep 03 2017 *)

Extensions

Extended by Ray Chandler, Mar 11 2010

A175023 Irregular table read by rows: Row n (of A175022(n) terms) contains the run-lengths in the binary representation of A175020(n), reading left to right.

Original entry on oeis.org

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

Views

Author

Leroy Quet, Nov 03 2009

Keywords

Comments

This table lists the parts of the partitions of the positive integers. Each partition is represented exactly once in this table. If n is such that 2^(m-1) <= A175020(n) <= 2^m -1, then row n of this table gives one partition of m.

Examples

			Table to start:
1
1,1
2
1,2
1,1,1
3
1,3
1,2,1
1,1,1,1
2,2
4
1,4
1,3,1
1,2,1,1
1,2,2
1,1,1,1,1
2,3
5
Note there are: 1 row that sums to 1, two rows that sum to 2, three rows that sum to 3, five rows that sum to 4, seven rows that sum to 5, etc, where 1,2,3,5,7,... are the number of unrestricted partitions of 1,2,3,4,5,...
		

Crossrefs

Programs

  • Maple
    Contribution from R. J. Mathar, Feb 27 2010: (Start)
    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:
    A175023 := 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 ; end if; end do ; printf("%a,",thisLset) ; return ; end proc:
    for n from 1 to 80 do A175023(n) ; end do; (End)
  • Mathematica
    With[{s = Array[Sort@ Map[Length, Split@ IntegerDigits[#, 2]] &, 73]}, Map[Length /@ Split@ IntegerDigits[#, 2] &, Values[PositionIndex@ s][[All, 1]] ]] // Flatten (* Michael De Vlieger, Sep 03 2017 *)

Extensions

Terms beyond the 18th row from R. J. Mathar, Feb 27 2010

A167755 Match the multisets in A175020 with those in A037016 then merge the two sequences.

Original entry on oeis.org

1, 1, 2, 2, 3, 3, 5, 5, 4, 6, 7, 7, 10, 10, 12, 12, 9, 13, 8, 14, 15, 15, 21, 21, 19, 25, 18, 26, 24, 28, 17, 29, 16, 30, 31, 31, 42, 42, 36, 50, 51, 51, 37, 53, 56, 56, 35, 57, 34, 58, 48, 60, 33, 61, 32, 62, 63, 63
Offset: 1

Views

Author

Alford Arnold, Nov 10 2009

Keywords

Comments

A175020 records the multiset with minimum value; whereas A037016 is based on reading binary expansion from right to left, run lengths increase.

Examples

			After the initial zero, A037016 begins:
  1
  2 3
  5 6 7
  10 12 13 14 15
  21 25 26 28 29 30 31
  42 50 51 53 56 57 58 60 61 62 63
  85 ...
and after resorting, A175020 begins:
  1
  2 3
  5 4 7
  10 12 9 8 15
  21 ...
so the irregular table begins:
  1 1
  2 2 3 3
  5 5 4 6 7 7
  10 10 12 12 9 13 8 14 15 15
  etc.
In binary, the number 9 maps to multiset (1,2,1) and the number 13 maps to (2,1,1), so 9 and 13 appear together in the sequence.
		

Crossrefs

Cf. A000041 (1/2 row length of the irregular Table). A000975 (first & second column).

A175024 Irregular table read by rows: Row n (of A175022(n) terms) contains the terms of row n of table A175023 with these terms arranged in nondecreasing order.

Original entry on oeis.org

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

Views

Author

Leroy Quet, Nov 03 2009

Keywords

Comments

This table lists the parts of the partitions of the positive integers. Each partition is represented exactly once in this table. If n is such that 2^(m-1) <= A175020(n) <= 2^m -1, then row n of this table gives one partition of m.

Examples

			Table to start:
1
1,1
2
1,2
1,1,1
3
1,3
1,1,2
1,1,1,1
2,2
4
1,4
1,1,3
1,1,1,2
1,2,2
1,1,1,1,1
2,3
5
Note there are: 1 row that sums to 1, two rows that sum to 2, three rows that sum to 3, five rows that sum to 4, seven rows that sum to 5, etc, where 1,2,3,5,7,... are the number of unrestricted partitions of 1,2,3,4,5,...
		

Crossrefs

Extensions

Extended by Ray Chandler, Mar 11 2010

A175021 A positive integer k is included if k is not 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

6, 11, 13, 14, 20, 22, 23, 25, 26, 27, 28, 29, 30, 38, 39, 40, 41, 43, 44, 45, 46, 47, 49, 50, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62, 70, 72, 75, 77, 78, 79, 80, 81, 82, 83, 84, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97, 98, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109
Offset: 1

Views

Author

Leroy Quet, Nov 03 2009

Keywords

Comments

A175020 contains those positive integers not in this sequence.

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 not 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, 23 is in this sequence.
		

Crossrefs

Cf. A175020.

Programs

  • Mathematica
    Block[{nn = 109, s}, s = Array[Sort@ Map[Length, Split@ IntegerDigits[#, 2]] &, nn]; Complement[Range[nn], Values[PositionIndex@ s][[All, 1]] ]] (* Michael De Vlieger, Sep 03 2017 *)
  • PARI
    {A175021_first(n)=my(k, S=[]); vector(n,R, while(!setsearch(S, R=vecsort(A101211_row(k++))), S=setunion(S,[R])); k)} \\ M. F. Hasler, Mar 11 2025
    
  • Python
    from itertools import count, groupby
    def A175021(n=None, stop=3**33): # return a(n) or generator of sequence if no n given
        if not n: return(A175021(n)for n in range(1, stop))
        if not hasattr(A := A175021, 'terms'): A.terms=[0]; A.rls=set(); A.signature=\
            lambda n: tuple(sorted(len(list(g)) for _,g in groupby(bin(n)[2:])))
        while n>=len(A.terms):
           A.terms.append(next(k for k in count(A.terms[-1]+1)
               if(s:=A.signature(k)) in A.rls or A.rls.add(s)))
        return A.terms[n] # M. F. Hasler, Mar 11 2025

Extensions

Extended by Ray Chandler, Mar 11 2010

A361479 a(n) is the least integer whose binary expansion has the same multiset of run-lengths as that of n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 4, 7, 8, 9, 10, 9, 12, 9, 8, 15, 16, 17, 18, 19, 18, 21, 18, 17, 24, 19, 18, 19, 24, 17, 16, 31, 32, 33, 34, 35, 36, 37, 36, 35, 34, 37, 42, 37, 36, 37, 34, 33, 48, 35, 36, 51, 36, 37, 36, 35, 56, 35, 34, 35, 48, 33, 32, 63, 64, 65, 66, 67
Offset: 0

Views

Author

Rémy Sigrist, Mar 13 2023

Keywords

Crossrefs

Programs

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

Formula

a(a(n)) = a(n).
a(n) <= n with equality iff n = 0 or belongs to A175020.

A175025 Irregular table read by rows: Row n (of A175022(n) terms) contains the terms of row n of table A175023 with these terms arranged in nonincreasing order.

Original entry on oeis.org

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

Views

Author

Leroy Quet, Nov 03 2009

Keywords

Comments

This table lists the parts of the partitions of the positive integers. Each partition is represented exactly once in this table. If n is such that 2^(m-1) <= A175020(n) <= 2^m -1, then row n of this table gives one partition of m.

Examples

			Table to start:
1
1,1
2
2,1
1,1,1
3
3,1
2,1,1
1,1,1,1
2,2
4
4,1
3,1,1
2,1,1,1
2,2,1
1,1,1,1,1
3,2
5
Note there are: 1 row that sums to 1, two rows that sum to 2, three rows that sum to 3, five rows that sum to 4, seven rows that sum to 5, etc., where 1,2,3,5,7,... are the number of unrestricted partitions of 1,2,3,4,5,...
		

Crossrefs

Extensions

Extended by Ray Chandler, Mar 11 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-8 of 8 results.