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.

Previous Showing 11-20 of 24 results. Next

A124758 Product of the parts of the compositions in standard order.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

The standard order of compositions is given by A066099.
A composition of n is a finite sequence of positive integers summing to n. The k-th composition in standard order (row k of A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. - Gus Wiseman, Apr 03 2020

Examples

			Composition number 11 is 2,1,1; 2*1*1 = 2, so a(11) = 2.
The table starts:
  1
  1
  2 1
  3 2 2 1
  4 3 4 2 3 2 2 1
  5 4 6 3 6 4 4 2 4 3 4 2 3 2 2 1
The 146-th composition in standard order is (3,3,2), with product 18, so a(146) = 18. - _Gus Wiseman_, Apr 03 2020
		

Crossrefs

Cf. A066099, A118851, A011782 (row lengths), A001906 (row sums).
The lengths of standard compositions are given by A000120.
The version for prime indices is A003963.
The version for binary indices is A096111.
Taking the sum instead of product gives A070939.
The sum of binary indices is A029931.
The sum of prime indices is A056239.
Taking GCD instead of product gives A326674.
Positions of first appearances are A331579.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[Times@@stc[n],{n,0,100}] (* Gus Wiseman, Apr 03 2020 *)

Formula

For a composition b(1),...,b(k), a(n) = Product_{i=1}^k b(i).
a(A164894(n)) = a(A246534(n)) = n!. - Gus Wiseman, Apr 03 2020
a(A233249(n)) = a(A333220(n)) = A003963(n). - Gus Wiseman, Apr 03 2020
From Mikhail Kurkov, Jul 11 2021: (Start)
Some conjectures:
a(2n+1) = a(n) for n >= 0.
a(2n) = (1 + 1/A001511(n))*a(n) = 2*a(n) + a(n - 2^f(n)) - a(2n - 2^f(n)) for n > 0 with a(0)=1 where f(n) = A007814(n).
From the 1st formula for a(2n) we get a(4n+2) = 2*a(n), a(4n) = 2*a(2n) - a(n).
Sum_{k=0..2^n - 1} a(k) = A001519(n+1) for n >= 0.
a((4^n - 1)/3) = A011782(n) for n >= 0.
a(2^m*(2^n - 1)) = m + 1 for n > 0, m >= 0. (End)

A233249 a(1)=0; for k >= 1, let prime(k) map to 10...0 with k-1 zeros and let prime(k)*prime(m) map to the concatenation in binary of 2^(k-1) and 2^(m-1). For n >= 2, let the prime power factorization of n be mapped to r(n). a(n) is the term in A114994 which is c-equivalent to r(n) (see there our comment).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 8, 7, 10, 9, 16, 11, 32, 17, 18, 15, 64, 21, 128, 19, 34, 33, 256, 23, 36, 65, 42, 35, 512, 37, 1024, 31, 66, 129, 68, 43, 2048, 257, 130, 39, 4096, 69, 8192, 67, 74, 513, 16384, 47, 136, 73, 258, 131, 32768, 85, 132, 71, 514, 1025, 65536, 75
Offset: 1

Views

Author

Vladimir Shevelev, Dec 06 2013

Keywords

Comments

Let (10...0)_i (i>=0) denote 2^i in binary. Under (10...0)_i^k we understand a concatenation of (10...0)_i k times.
If n=Product_{i=1..m} p_i^t_i is the prime power factorization of n, then in the name r(n)=concatenation{i=1..m} ((10...0_(i-1)^t_i).
Numbers q and s are called c-equivalent if their binary expansions contain the same set of parts of the form 10...0. For example, 14=(1)(1)(10)~(10)(1)(1)=11.
Conversely, if n~n_1 such that n_1 is in A114994 and has c-factorization: n_1 = concatenation{i=m,...,0} ((10...0)i^t_i), one can consider "converse" sequence {s(n)}, where s(n) = Product{i=m..0} p_(i+1)^t_i.
For example, for n=22, n_1=21=((10)^2)(1), and s(22)=3^2*2=18.
The k-th composition in standard order (row k of A066099) is obtained by taking the set of positions of 1's in the reversed binary binary expansion of k, prepending 0, taking first differences, and reversing again. Then a(n) is the number k such that the k-th composition in standard order consists of the prime indices of n in weakly decreasing order (the partition with Heinz number n). - Gus Wiseman, Apr 02 2020

Examples

			n=10=2*5 is mapped to (1)(100)~(100)(1). Since 9 is in A114994, then a(10)=9.
From _Gus Wiseman_, Apr 02 2020: (Start)
The sequence together with the corresponding compositions begins:
   0: ()             128: (8)             2048: (12)
   1: (1)             19: (3,1,1)          257: (8,1)
   2: (2)             34: (4,2)            130: (6,2)
   3: (1,1)           33: (5,1)             39: (3,1,1,1)
   4: (3)            256: (9)             4096: (13)
   5: (2,1)           23: (2,1,1,1)         69: (4,2,1)
   8: (4)             36: (3,3)           8192: (14)
   7: (1,1,1)         65: (6,1)             67: (5,1,1)
  10: (2,2)           42: (2,2,2)           74: (3,2,2)
   9: (3,1)           35: (4,1,1)          513: (9,1)
  16: (5)            512: (10)           16384: (15)
  11: (2,1,1)         37: (3,2,1)           47: (2,1,1,1,1)
  32: (6)           1024: (11)             136: (4,4)
  17: (4,1)           31: (1,1,1,1,1)       73: (3,3,1)
  18: (3,2)           66: (5,2)            258: (7,2)
  15: (1,1,1,1)      129: (7,1)            131: (6,1,1)
  64: (7)             68: (4,3)          32768: (16)
  21: (2,2,1)         43: (2,2,1,1)         85: (2,2,2,1)
For example, the Heinz number of (2,2,1) is 18, and the 21st composition in standard order is (2,2,1), so a(18) = 21.
(End)
		

Crossrefs

The sorted version is A114994.
The primorials A002110 map to A246534.
A partial inverse is A333219.
The reversed version is A333220.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Table[Total[2^Accumulate[primeMS[n]]]/2,{n,100}] (* Gus Wiseman, Apr 02 2020 *)

Formula

A059893(a(n)) = A333220(n). A124767(a(n)) = A001221(n). - Gus Wiseman, Apr 02 2020

Extensions

More terms from Peter J. C. Moses, Dec 07 2013

A164894 Base-10 representation of the binary string formed by appending 10, 100, 1000, 10000, ..., etc., to 1.

Original entry on oeis.org

1, 6, 52, 840, 26896, 1721376, 220336192, 56406065280, 28879905423616, 29573023153783296, 60565551418948191232, 248076498612011791288320, 2032242676629600594233921536, 33296264013899376135928570454016, 1091051979207454757222107396637212672
Offset: 1

Views

Author

Gil Broussard, Aug 29 2009

Keywords

Comments

These numbers are half the sum of powers of 2 indexed by differences of a triangular number and each smaller triangular number (e.g., 21 - 15 = 6, 21 - 10 = 11, ..., 21 - 0 = 21).
This suggests another way to think about these numbers: consider the number triangle formed by the characteristic function of the triangular numbers (A010054), join together the first n rows (the very first row is row 0) as a single binary string and that gives the (n + 1)th term of this sequence. - Alonso del Arte, Nov 15 2013
Numbers k such that the k-th composition in standard order (row k of A066099) is an initial interval. - Gus Wiseman, Apr 02 2020

Examples

			a(1) = 1, also 1 in binary.
a(2) = 6, or 110 in binary.
a(3) = 52, or 110100 in binary.
a(4) = 840, or 1101001000 in binary.
		

Crossrefs

The version for prime (rather than binary) indices is A002110.
The non-strict generalization is A225620.
The reversed version is A246534.
Standard composition numbers of permutations are A333218.
Standard composition numbers of strict increasing compositions are A333255.

Programs

  • Mathematica
    Table[Sum[2^((n^2 + n)/2 - (k^2 + k)/2 - 1), {k, 0, n - 1}], {n, 25}] (* Alonso del Arte, Nov 14 2013 *)
    Module[{nn=15,t},t=Table[10^n,{n,0,nn}];Table[FromDigits[Flatten[IntegerDigits/@Take[t,k]],2],{k,nn}]] (* Harvey P. Dale, Jan 16 2024 *)
  • Python
    def a(n): return int("".join("1"+"0"*i for i in range(n)), 2)
    print([a(n) for n in range(1, 16)]) # Michael S. Branicky, Jul 05 2021
    
  • Python
    def A164894(n): return sum(1<<(k*((n<<1)-k-1)>>1)+n-1 for k in range(n)) # Chai Wah Wu, Jul 11 2025

Formula

a(n) = Sum_{k=0..n-1} 2^((n^2 + n)/2 - (k^2 + k)/2 - 1). - Alonso del Arte, Nov 15 2013
Intersection of A333255 and A333217. - Gus Wiseman, Apr 02 2020
a(n) = Sum_{k=0..n-1} 2^(k*(2*n-k-1)/2+n-1). - Chai Wah Wu, Jul 11 2025

A124761 Number of falls for compositions in standard order.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

The standard order of compositions is given by A066099.
A composition of n is a finite sequence of positive integers summing to n. The k-th composition in standard order (row k of A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. a(n) is one fewer than the number of maximal weakly increasing runs in this composition. Alternatively, a(n) is the number of strict descents in the same composition. For example, the weakly increasing of runs of the 1234567th composition are ((3),(2),(1,2,2),(1,2,5),(1,1,1)), so a(1234567) = 5 - 1 = 4. The 4 strict descents together with the weak ascents are: 3 > 2 > 1 <= 2 <= 2 > 1 <= 2 <= 5 > 1 <= 1 <= 1. - Gus Wiseman, Apr 08 2020

Examples

			Composition number 11 is 2,1,1; 2>1<=1, so a(11) = 1.
The table starts:
  0
  0
  0 0
  0 1 0 0
  0 1 0 1 0 1 0 0
  0 1 1 1 0 1 1 1 0 1 0 1 0 1 0 0
  0 1 1 1 0 2 1 1 0 1 0 1 1 2 1 1 0 1 1 1 0 1 1 1 0 1 0 1 0 1 0 0
		

Crossrefs

Cf. A066099, A124760, A124763, A124764, A011782 (row lengths), A045883 (row sums), A333213, A333220, A333379.
Positions of zeros are A225620.
Compositions of n with k strict descents are A238343.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Sum is A070939.
- Weakly decreasing compositions are A114994.
- Adjacent equal pairs are counted by A124762.
- Weakly decreasing runs are counted by A124765.
- Weakly increasing runs are counted by A124766.
- Equal runs are counted by A124767.
- Strictly increasing runs are counted by A124768.
- Strictly decreasing runs are counted by A124769.
- Weakly increasing compositions are A225620.
- Reverse is A228351 (triangle).
- Strict compositions are A233564.
- Initial intervals are A246534.
- Constant compositions are A272919.
- Normal compositions are A333217.
- Permutations are A333218.
- Strictly decreasing compositions are A333255.
- Strictly increasing compositions are A333256.
- Runs-resistance is A333628.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[Length[Select[Partition[stc[n],2,1],Greater@@#&]],{n,0,100}] (* Gus Wiseman, Apr 08 2020 *)

Formula

For a composition b(1),...,b(k), a(n) = Sum_{1<=i=1b(i+1)} 1.
For n > 0, a(n) = A124766(n) - 1. - Gus Wiseman, Apr 08 2020

A124763 Number of non-rises (levels or falls) for compositions in standard order.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

The standard order of compositions is given by A066099.
A composition of n is a finite sequence of positive integers summing to n. The k-th composition in standard order (row k of A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. a(n) is one fewer than the number of maximal strictly increasing runs in this composition. Alternatively, a(n) is the number of weak descents in the same composition. For example, the strictly increasing runs of the 1234567th composition are ((3),(2),(1,2),(2),(1,2,5),(1),(1),(1)), so a(1234567) = 8 - 1 = 7. The 7 weak descents together with the strict ascents are: 3 >= 2 >= 1 < 2 >= 2 >= 1 < 2 < 5 >= 1 >= 1 >= 1. - Gus Wiseman, Apr 08 2020

Examples

			Composition number 11 is 2,1,1; 2>=1>=1, so a(11) = 2.
The table starts:
  0
  0
  0 1
  0 1 0 2
  0 1 1 2 0 1 1 3
  0 1 1 2 0 2 1 3 0 1 1 2 1 2 2 4
  0 1 1 2 1 2 1 3 0 1 2 3 1 2 2 4 0 1 1 2 0 2 1 3 1 2 2 3 2 3 3 5
		

Crossrefs

Cf. A029931, A066099, A124760, A124761, A124764, A011782 (row lengths), A045883 (row sums), A238343, A333220.
Compositions of n with k weak descents are A333213.
Positions of zeros are A333255.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Partial sums from the right are A048793.
- Sum is A070939.
- Weakly decreasing compositions are A114994.
- Adjacent equal pairs are counted by A124762.
- Weakly decreasing runs are counted by A124765.
- Weakly increasing runs are counted by A124766.
- Equal runs are counted by A124767.
- Strictly increasing runs are counted by A124768.
- Strictly decreasing runs are counted by A124769.
- Weakly increasing compositions are A225620.
- Reverse is A228351 (triangle).
- Strict compositions are A233564.
- Initial intervals are A246534.
- Constant compositions are A272919.
- Normal compositions are A333217.
- Permutations are A333218.
- Heinz number is A333219.
- Strictly decreasing compositions are A333255.
- Strictly increasing compositions are A333256.
- Anti-runs are A333489.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[Length[Select[Partition[stc[n],2,1],GreaterEqual@@#&]],{n,0,100}] (* Gus Wiseman, Apr 08 2020 *)

Formula

For a composition b(1),...,b(k), a(n) = Sum_{1<=i=1=b(i+1)} 1.
a(n) = A124761(n) + A124762(n).
For n > 0, a(n) = A124768(n) - 1. - Gus Wiseman, Apr 08 2020

A333379 Numbers k such that the k-th composition in standard order is weakly increasing and covers an initial interval of positive integers.

Original entry on oeis.org

0, 1, 3, 6, 7, 14, 15, 26, 30, 31, 52, 58, 62, 63, 106, 116, 122, 126, 127, 212, 234, 244, 250, 254, 255, 420, 426, 468, 490, 500, 506, 510, 511, 840, 852, 932, 938, 980, 1002, 1012, 1018, 1022, 1023, 1700, 1706, 1864, 1876, 1956, 1962, 2004, 2026, 2036, 2042
Offset: 1

Views

Author

Gus Wiseman, Mar 21 2020

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n. The k-th composition in standard order (row k of A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again.

Examples

			The sequence of terms together with the corresponding compositions begins:
    0: ()               127: (1,1,1,1,1,1,1)
    1: (1)              212: (1,2,2,3)
    3: (1,1)            234: (1,1,2,2,2)
    6: (1,2)            244: (1,1,1,2,3)
    7: (1,1,1)          250: (1,1,1,1,2,2)
   14: (1,1,2)          254: (1,1,1,1,1,1,2)
   15: (1,1,1,1)        255: (1,1,1,1,1,1,1,1)
   26: (1,2,2)          420: (1,2,3,3)
   30: (1,1,1,2)        426: (1,2,2,2,2)
   31: (1,1,1,1,1)      468: (1,1,2,2,3)
   52: (1,2,3)          490: (1,1,1,2,2,2)
   58: (1,1,2,2)        500: (1,1,1,1,2,3)
   62: (1,1,1,1,2)      506: (1,1,1,1,1,2,2)
   63: (1,1,1,1,1,1)    510: (1,1,1,1,1,1,1,2)
  106: (1,2,2,2)        511: (1,1,1,1,1,1,1,1,1)
  116: (1,1,2,3)        840: (1,2,3,4)
  122: (1,1,1,2,2)      852: (1,2,2,2,3)
  126: (1,1,1,1,1,2)    932: (1,1,2,3,3)
		

Crossrefs

Sequences covering an initial interval are counted by A000670.
Compositions in standard order are A066099.
Weakly increasing runs are counted by A124766.
Removing the covering condition gives A225620.
Removing the ordering condition gives A333217.
The strictly increasing case is A164894.
The strictly decreasing version is A246534.
The unequal version is A333218.
The weakly decreasing version is A333380.

Programs

  • Mathematica
    normQ[m_]:=Or[m=={},Union[m]==Range[Max[m]]];
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,1000],normQ[stc[#]]&&LessEqual@@stc[#]&]

Formula

Intersection of A333217 and A225620.

A353929 Number of distinct sums of runs (of 0's or 1's) in the binary expansion of n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jun 26 2022

Keywords

Comments

Assuming the binary digits are not all 1, this is one more than the number of different lengths of runs of 1's in the binary expansion of n.

Examples

			The binary expansion of 183 is (1,0,1,1,0,1,1,1), with runs (1), (0), (1,1), (0), (1,1,1), with sums 1, 0, 2, 0, 3, of which four are distinct, so a(183) = 4.
		

Crossrefs

For lengths of all runs we have A165413, firsts A165933.
Numbers whose binary expansion has distinct runs are A175413.
For runs instead of run-sums we have A297770, firsts A350952.
For prime indices we have A353835, weak A353861, firsts A006939.
For standard compositions we have A353849, firsts A246534.
Positions of first appearances are A353930.
A005811 counts runs in binary expansion.
A044813 lists numbers with distinct run-lengths in binary expansion.
A318928 gives runs-resistance of binary expansion.
A351014 counts distinct runs in standard compositions.

Programs

  • Mathematica
    Table[Length[Union[Total/@Split[IntegerDigits[n,2]]]],{n,0,100}]
  • Python
    from itertools import groupby
    def A353929(n): return len(set(sum(map(int,y[1])) for y in groupby(bin(n)[2:]))) # Chai Wah Wu, Jun 26 2022

A353930 Smallest number whose binary expansion has n distinct run-sums.

Original entry on oeis.org

1, 2, 11, 183, 5871, 375775, 48099263, 12313411455, 6304466665215, 6455773865180671, 13221424875890015231, 54154956291645502388223, 443637401941159955564326911, 7268555193403964711965932118015, 238176016577461115681699663643131903, 15609103422420491677315869156516292427775
Offset: 1

Views

Author

Gus Wiseman, Jun 07 2022

Keywords

Comments

Every sequence can be uniquely split into a sequence of non-overlapping runs. For example, the runs of (2,2,1,1,1,3,2,2) are ((2,2),(1,1,1),(3),(2,2)), with sums (4,3,3,4).

Examples

			The terms, binary expansions, and standard compositions begin:
       1:                    1  (1)
       2:                   10  (2)
      11:                 1011  (2,1,1)
     183:             10110111  (2,1,2,1,1,1)
    5871:        1011011101111  (2,1,2,1,1,2,1,1,1,1)
  375775:  1011011101111011111  (2,1,2,1,1,2,1,1,1,2,1,1,1,1,1)
		

Crossrefs

Essentially the same as A215203.
For prime indices instead of binary expansion we have A006939.
For lengths instead of sums of runs we have A165933 = firsts in A165413.
Numbers whose binary expansion has all distinct runs are A175413.
For standard compositions we have A246534, firsts of A353849.
For runs instead of run-sums we have A350952, firsts of A297770.
These are the positions of first appearances in A353929.
A005811 counts runs in binary expansion.
A242882 counts compositions with distinct multiplicities.
A318928 gives runs-resistance of binary expansion.
A351014 counts distinct runs in standard compositions.
A353835 counts partitions with all distinct run-sums, weak A353861.
A353864 counts rucksack partitions.

Programs

  • Mathematica
    qe=Table[Length[Union[Total/@Split[IntegerDigits[n,2]]]],{n,1,10000}];
    Table[Position[qe,i][[1,1]],{i,Max@@qe}]
  • PARI
    a(n) = {my(t=1); if(n==2, t<<=1, for(k=3, n, t = (t<Andrew Howroyd, Jan 01 2023

Extensions

Offset corrected and terms a(7) and beyond from Andrew Howroyd, Jan 01 2023

A333380 Numbers k such that the k-th composition in standard order is weakly decreasing and covers an initial interval of positive integers.

Original entry on oeis.org

0, 1, 3, 5, 7, 11, 15, 21, 23, 31, 37, 43, 47, 63, 75, 85, 87, 95, 127, 149, 151, 171, 175, 191, 255, 293, 299, 303, 341, 343, 351, 383, 511, 549, 587, 597, 599, 607, 683, 687, 703, 767, 1023, 1099, 1173, 1175, 1195, 1199, 1215, 1365, 1367, 1375, 1407, 1535
Offset: 1

Views

Author

Gus Wiseman, Mar 21 2020

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n. The k-th composition in standard order (row k of A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again.

Examples

			The sequence of terms together with the corresponding compositions begins:
    0: ()               127: (1,1,1,1,1,1,1)
    1: (1)              149: (3,2,2,1)
    3: (1,1)            151: (3,2,1,1,1)
    5: (2,1)            171: (2,2,2,1,1)
    7: (1,1,1)          175: (2,2,1,1,1,1)
   11: (2,1,1)          191: (2,1,1,1,1,1,1)
   15: (1,1,1,1)        255: (1,1,1,1,1,1,1,1)
   21: (2,2,1)          293: (3,3,2,1)
   23: (2,1,1,1)        299: (3,2,2,1,1)
   31: (1,1,1,1,1)      303: (3,2,1,1,1,1)
   37: (3,2,1)          341: (2,2,2,2,1)
   43: (2,2,1,1)        343: (2,2,2,1,1,1)
   47: (2,1,1,1,1)      351: (2,2,1,1,1,1,1)
   63: (1,1,1,1,1,1)    383: (2,1,1,1,1,1,1,1)
   75: (3,2,1,1)        511: (1,1,1,1,1,1,1,1,1)
   85: (2,2,2,1)        549: (4,3,2,1)
   87: (2,2,1,1,1)      587: (3,3,2,1,1)
   95: (2,1,1,1,1,1)    597: (3,2,2,2,1)
		

Crossrefs

Sequences covering an initial interval are counted by A000670.
Compositions in standard order are A066099.
Weakly decreasing runs are counted by A124765.
Removing the covering condition gives A114994.
Removing the ordering condition gives A333217.
The strictly decreasing case is A246534.
The unequal version is A333218.
The weakly increasing version is A333379.

Programs

  • Mathematica
    normQ[m_]:=Or[m=={},Union[m]==Range[Max[m]]];
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,1000],normQ[stc[#]]&&GreaterEqual@@stc[#]&]

Formula

Intersection of A333217 and A114994.

A354907 Number of distinct sums of contiguous constant subsequences (partial runs) of the n-th composition in standard order.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jun 23 2022

Keywords

Comments

The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.
Every sequence can be uniquely split into a sequence of non-overlapping runs. For example, the runs of (2,2,1,1,1,3,2,2) are ((2,2),(1,1,1),(3),(2,2)), with sums (4,3,3,4).

Examples

			Composition number 981 in standard order is (1,1,1,2,2,2,1), with partial runs (1), (2), (1,1), (2,2), (1,1,1), (2,2,2), with distinct sums {1,2,3,4,6}, so a(981) = 5.
		

Crossrefs

Positions of 1's are A000051.
Positions of first appearances are A000079.
The standard compositions used here are A066099, run-sums A353847/A353932.
If we allow any subsequence we get A334968.
The case of full runs is A353849, firsts A246534.
A version for nonempty partitions is A353861, full A353835.
Counting all distinct runs (instead of their distinct sums) gives A354582.
A124767 counts runs in standard compositions.
A238279 and A333755 count compositions by number of runs.
A330036 counts distinct partial runs of prime indices, full A005811.
A351014 counts distinct runs of standard compositions, firsts A351015.
A353853-A353859 pertain to composition run-sum trajectory.
A353860 counts collapsible compositions.
A354584 lists run-sums of prime indices, rows ranked by A353832.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    pre[y_]:=NestWhileList[Most,y,Length[#]>1&];
    Table[Length[Union[Total/@Join@@pre/@Split[stc[n]]]],{n,0,100}]
Previous Showing 11-20 of 24 results. Next