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-10 of 44 results. Next

A304442 Number of partitions of n in which the sequence of the sum of the same summands is constant.

Original entry on oeis.org

1, 1, 2, 2, 4, 2, 5, 2, 7, 3, 5, 2, 13, 2, 5, 4, 11, 2, 13, 2, 12, 4, 5, 2, 28, 3, 5, 5, 12, 2, 18, 2, 17, 4, 5, 4, 44, 2, 5, 4, 24, 2, 18, 2, 12, 10, 5, 2, 63, 3, 9, 4, 12, 2, 34, 4, 24, 4, 5, 2, 67, 2, 5, 10, 27, 4, 18, 2, 12, 4, 14, 2, 120, 2, 5, 7, 12, 4, 18, 2, 54
Offset: 0

Views

Author

Seiichi Manyama, May 12 2018

Keywords

Comments

Said differently, these are partitions whose run-sums are all equal. - Gus Wiseman, Jun 25 2022

Examples

			a(72) = binomial(d(72),1) + binomial(d(36),2) + binomial(d(24),3) + binomial(d(18),4) + binomial(d(12),6) = 12 + 36 + 56 + 15 + 1 = 120, where d(n) is the number of divisors of n.
--+----------------------+-----------------------------------------
n |                      | Sequence of the sum of the same summands
--+----------------------+-----------------------------------------
1 | 1                    | 1
2 | 2                    | 2
  | 1+1                  | 2
3 | 3                    | 3
  | 1+1+1                | 3
4 | 4                    | 4
  | 2+2                  | 4
  | 2+1+1                | 2, 2
  | 1+1+1+1              | 4
5 | 5                    | 5
  | 1+1+1+1+1            | 5
6 | 6                    | 6
  | 3+3                  | 6
  | 3+1+1+1              | 3, 3
  | 2+2+2                | 6
  | 1+1+1+1+1+1          | 6
		

Crossrefs

All parts are divisors of n, see A018818, compositions A100346.
For run-lengths instead of run-sums we have A047966, compositions A329738.
These partitions are ranked by A353833.
The distinct instead of equal version is A353837, ranked by A353838, compositions A353850.
The version for compositions is A353851, ranked by A353848.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n],SameQ@@Total/@Split[#]&]],{n,0,15}] (* Gus Wiseman, Jun 25 2022 *)
  • PARI
    a(n) = if (n==0, 1, sumdiv(n, d, binomial(numdiv(n/d), d))); \\ Michel Marcus, May 13 2018

Formula

a(n) >= 2 for n > 1.
a(n) = Sum_{d|n} binomial(A000005(n/d), d) for n > 0.

A353832 Heinz number of the multiset of run-sums of the prime indices of n.

Original entry on oeis.org

1, 2, 3, 3, 5, 6, 7, 5, 7, 10, 11, 9, 13, 14, 15, 7, 17, 14, 19, 15, 21, 22, 23, 15, 13, 26, 13, 21, 29, 30, 31, 11, 33, 34, 35, 21, 37, 38, 39, 25, 41, 42, 43, 33, 35, 46, 47, 21, 19, 26, 51, 39, 53, 26, 55, 35, 57, 58, 59, 45, 61, 62, 49, 13, 65, 66, 67, 51, 69, 70, 71, 35, 73, 74, 39, 57, 77, 78, 79, 35, 19
Offset: 1

Views

Author

Gus Wiseman, May 23 2022

Keywords

Comments

The sequence of runs of a sequence consists of its maximal consecutive constant subsequences when read left-to-right. 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).
The Heinz number of a partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k). This gives a bijective correspondence between positive integers and integer partitions.
This sequence represents the transformation f(P) described by Kimberling at A237685.

Examples

			The prime indices of 1260 are {1,1,2,2,3,4}, with run-sums (2,4,3,4), and the multiset {2,3,4,4} has Heinz number 735, so a(1260) = 735.
		

Crossrefs

The number of distinct prime factors of a(n) is A353835, weak A353861.
The version for compositions is A353847, listed A353932.
The greatest prime factor of a(n) has index A353862, least A353931.
A001222 counts prime factors, distinct A001221.
A056239 adds up prime indices, row sums of A112798 and A296150.
A300273 ranks collapsible partitions, counted by A275870.
A353833 ranks partitions with all equal run-sums, counted by A304442.
A353838 ranks partitions with all distinct run-sums, counted by A353837.
A353840-A353846 pertain to partition run-sum trajectory.
A353851 counts compositions w/ all equal run-sums, ranked by A353848.
A353864 counts rucksack partitions, ranked by A353866.
A353865 counts perfect rucksack partitions, ranked by A353867.
Cf. A005811, A047966, A071625, A073093, A181819, A182850, A182857, A304660, A323014, A353834, A353839, A353841 (1 + iterations needed to reach a squarefree number).

Programs

  • Mathematica
    Table[Times@@Prime/@Cases[If[n==1,{},FactorInteger[n]],{p_,k_}:>PrimePi[p]*k],{n,100}]
  • PARI
    pis_to_runs(n) = { my(runs=List([]), f=factor(n)); for(i=1,#f~,while(f[i,2], listput(runs,primepi(f[i,1])); f[i,2]--)); (runs); };
    A353832(n) = if(1==n,n,my(pruns = pis_to_runs(n), m=1, runsum=pruns[1]); for(i=2,#pruns,if(pruns[i] == pruns[i-1], runsum += pruns[i], m *= prime(runsum); runsum = pruns[i])); (m*prime(runsum))); \\ Antti Karttunen, Jan 20 2025

Formula

A001222(a(n)) = A001221(n).
A001221(a(n)) = A353835(n).
A061395(a(n)) = A353862(n).

Extensions

More terms from Antti Karttunen, Jan 20 2025

A353837 Number of integer partitions of n with all distinct run-sums.

Original entry on oeis.org

1, 1, 2, 3, 4, 7, 10, 14, 17, 28, 35, 49, 62, 85, 107, 149, 174, 238, 305, 384, 476, 614, 752, 950, 1148, 1451, 1763, 2205, 2654, 3259, 3966, 4807, 5773, 7039, 8404, 10129, 12140, 14528, 17288, 20668, 24505, 29062, 34437, 40704, 48059, 56748, 66577, 78228
Offset: 0

Views

Author

Gus Wiseman, May 26 2022

Keywords

Comments

The run-sums of a sequence are the sums of its maximal consecutive constant subsequences (runs). For example, the run-sums of (2,2,1,1,1,3,2,2) are (4,3,3,4). The first partition whose run-sums are not all distinct is (2,1,1).

Examples

			The a(0) = 1 through a(6) = 10 partitions:
  ()  (1)  (2)   (3)    (4)     (5)      (6)
           (11)  (21)   (22)    (32)     (33)
                 (111)  (31)    (41)     (42)
                        (1111)  (221)    (51)
                                (311)    (222)
                                (2111)   (321)
                                (11111)  (411)
                                         (2211)
                                         (21111)
                                         (111111)
		

Crossrefs

For multiplicities instead of run-sums we have A098859, ranked by A130091.
For equal run-sums we have A304442, ranked by A353833 (nonprime A353834).
These partitions are ranked by A353838, complement A353839.
The version for compositions is A353850, ranked by A353852.
The weak version (rucksack partitions) is A353864, ranked by A353866.
The weak perfect version is A353865, ranked by A353867.
A005811 counts runs in binary expansion.
A275870 counts collapsible partitions, ranked by A300273.
A351014 counts distinct runs in standard compositions.
A353832 represents the operation of taking run-sums of a partition.
A353840-A353846 pertain to partition run-sum trajectory.
A353849 counts distinct run-sums in standard compositions.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n],UnsameQ@@Total/@Split[#]&]],{n,0,15}]
  • Sage
    a353837 = lambda n: sum( abs(BipartiteGraph( Matrix(len(p), len(D:=list(set.union(*map(lambda t: set(divisors(t)),p)))), lambda i,j: p[i]%D[j]==0) ).matching_polynomial()[len(D)-len(p)]) for p in Partitions(n,max_slope=-1) ) # Max Alekseyev, Sep 11 2023

A353847 Composition run-sum transformation in terms of standard composition numbers. The a(k)-th composition in standard order is the sequence of run-sums of the k-th composition in standard order. Takes each index of a row of A066099 to the index of the row consisting of its run-sums.

Original entry on oeis.org

0, 1, 2, 2, 4, 5, 6, 4, 8, 9, 8, 10, 12, 13, 10, 8, 16, 17, 18, 18, 20, 17, 22, 20, 24, 25, 24, 26, 20, 21, 18, 16, 32, 33, 34, 34, 32, 37, 38, 36, 40, 41, 32, 34, 44, 45, 42, 40, 48, 49, 50, 50, 52, 49, 54, 52, 40, 41, 40, 42, 36, 37, 34, 32, 64, 65, 66, 66
Offset: 0

Views

Author

Gus Wiseman, May 30 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).
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.

Examples

			As a triangle:
   0
   1
   2  2
   4  5  6  4
   8  9  8 10 12 13 10  8
  16 17 18 18 20 17 22 20 24 25 24 26 20 21 18 16
These are the standard composition numbers of the following compositions (transposed):
  ()  (1)  (2)  (3)    (4)      (5)
           (2)  (2,1)  (3,1)    (4,1)
                (1,2)  (4)      (3,2)
                (3)    (2,2)    (3,2)
                       (1,3)    (2,3)
                       (1,2,1)  (4,1)
                       (2,2)    (2,1,2)
                       (4)      (2,3)
                                (1,4)
                                (1,3,1)
                                (1,4)
                                (1,2,2)
                                (2,3)
                                (2,2,1)
                                (3,2)
                                (5)
		

Crossrefs

Standard compositions are listed by A066099.
The version for partitions is A353832.
The run-sums themselves are listed by A353932, with A353849 distinct terms.
A005811 counts runs in binary expansion.
A300273 ranks collapsible partitions, counted by A275870.
A353838 ranks partitions with all distinct run-sums, counted by A353837.
A353851 counts compositions with all equal run-sums, ranked by A353848.
A353840-A353846 pertain to partition run-sum trajectory.
A353852 ranks compositions with all distinct run-sums, counted by A353850.
A353853-A353859 pertain to composition run-sum trajectory.
A353860 counts collapsible compositions.
A353863 counts run-sum-complete partitions.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    stcinv[q_]:=Total[2^(Accumulate[Reverse[q]])]/2;
    Table[stcinv[Total/@Split[stc[n]]],{n,0,100}]

A353833 Numbers whose multiset of prime indices has all equal run-sums.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 8, 9, 11, 12, 13, 16, 17, 19, 23, 25, 27, 29, 31, 32, 37, 40, 41, 43, 47, 49, 53, 59, 61, 63, 64, 67, 71, 73, 79, 81, 83, 89, 97, 101, 103, 107, 109, 112, 113, 121, 125, 127, 128, 131, 137, 139, 144, 149, 151, 157, 163, 167, 169, 173, 179
Offset: 1

Views

Author

Gus Wiseman, May 23 2022

Keywords

Comments

A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.
The sequence of runs of a sequence consists of its maximal consecutive constant subsequences when read left-to-right. 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 prime indices of 12 are {1,1,2}, with run-sums (2,2), so 12 is in the sequence.
		

Crossrefs

For parts instead of run-sums we have A000961, counted by A000005.
For run-lengths instead of run-sums we have A072774, counted by A047966.
These partitions are counted by A304442.
These are the positions of powers of primes in A353832.
The restriction to nonprimes is A353834.
For distinct instead of equal run-sums we have A353838, counted by A353837.
The version for compositions is A353848, counted by A353851.
A001222 counts prime factors, distinct A001221.
A005811 counts runs in binary expansion, distinct run-lengths A165413.
A056239 adds up prime indices, row sums of A112798 and A296150.
A124010 gives prime signature, sorted A118914.
A300273 ranks collapsible partitions, counted by A275870.
A353835 counts distinct run-sums of prime indices, weak A353861.
A353840-A353846 deal with iterated run-sums for partitions.
A353862 gives greatest run-sum of prime indices, least A353931.
A353866 ranks rucksack partitions, counted by A353864.

Programs

  • Mathematica
    Select[Range[100],SameQ@@Cases[FactorInteger[#],{p_,k_}:>PrimePi[p]*k]&]

A353850 Number of integer compositions of n with all distinct run-sums.

Original entry on oeis.org

1, 1, 2, 4, 5, 12, 24, 38, 52, 111, 218, 286, 520, 792, 1358, 2628, 4155, 5508, 9246, 13182, 23480, 45150, 54540, 94986, 146016, 213725, 301104, 478586, 851506, 1302234, 1775482, 2696942, 3746894, 6077784, 8194466, 12638334, 21763463, 28423976, 45309850, 62955524, 94345474
Offset: 0

Views

Author

Gus Wiseman, May 31 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 a(0) = 1 through a(5) = 12 compositions:
  ()  (1)  (2)   (3)    (4)     (5)
           (11)  (12)   (13)    (14)
                 (21)   (22)    (23)
                 (111)  (31)    (32)
                        (1111)  (41)
                                (113)
                                (122)
                                (221)
                                (311)
                                (1112)
                                (2111)
                                (11111)
For n=4, (211) is invalid because the two runs (2) and (11) have the same sum. - _Joseph Likar_, Aug 04 2023
		

Crossrefs

For distinct parts instead of run-sums we have A032020.
For distinct multiplicities instead of run-sums we have A242882.
For distinct run-lengths instead of run-sums we have A329739, ptns A098859.
For runs instead of run-sums we have A351013.
For partitions we have A353837, ranked by A353838 (complement A353839).
For equal instead of distinct run-sums we have A353851, ptns A304442.
These compositions are ranked by A353852.
The weak version (rucksack compositions) is A354580, ranked by A354581.
A003242 counts anti-run compositions, ranked by A333489.
A005811 counts runs in binary expansion.
A011782 counts compositions.
A175413 lists numbers whose binary expansion has all distinct runs.
A351014 counts distinct runs in standard compositions, firsts A351015.
A353847 gives composition run-sum transformation.
A353929 counts distinct runs in binary expansion, firsts A353930.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n], UnsameQ@@Total/@Split[#]&]],{n,0,15}]

Extensions

Terms a(21) and onwards from Joseph Likar, Aug 04 2023

A353932 Irregular triangle read by rows where row k lists the run-sums of the k-th composition in standard order.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jun 10 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).
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.

Examples

			Triangle begins:
  1
  2
  2
  3
  2 1
  1 2
  3
  4
  3 1
  4
  2 2
  1 3
  1 2 1
For example, composition 350 in standard order is (2,2,1,1,1,2), so row 350 is (4,3,2).
		

Crossrefs

Row-sums are A029837.
Standard compositions are listed by A066099.
Row-lengths are A124767.
These compositions are ranked by A353847.
Row k has A353849(k) distinct parts.
The version for partitions is A354584, ranked by A353832.
A005811 counts runs in binary expansion.
A300273 ranks collapsible partitions, counted by A275870.
A353838 ranks partitions with all distinct run-sums, counted by A353837.
A353851 counts compositions with all equal run-sums, ranked by A353848.
A353840-A353846 pertain to partition run-sum trajectory.
A353852 ranks compositions with all distinct run-sums, counted by A353850.
A353853-A353859 pertain to composition run-sum trajectory.
A353860 counts collapsible compositions.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[Total/@Split[stc[n]],{n,0,30}]

A353852 Numbers k such that the k-th composition in standard order (row k of A066099) has all distinct run-sums.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 15, 16, 17, 18, 19, 20, 21, 23, 24, 26, 28, 30, 31, 32, 33, 34, 35, 36, 37, 38, 40, 41, 42, 43, 44, 47, 48, 50, 51, 52, 55, 56, 57, 58, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 79, 80, 81, 84, 85, 86, 87, 88
Offset: 0

Views

Author

Gus Wiseman, May 31 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

			The terms together with their binary expansions and corresponding compositions begin:
   0:        0  ()
   1:        1  (1)
   2:       10  (2)
   3:       11  (1,1)
   4:      100  (3)
   5:      101  (2,1)
   6:      110  (1,2)
   7:      111  (1,1,1)
   8:     1000  (4)
   9:     1001  (3,1)
  10:     1010  (2,2)
  12:     1100  (1,3)
  15:     1111  (1,1,1,1)
  16:    10000  (5)
  17:    10001  (4,1)
  18:    10010  (3,2)
  19:    10011  (3,1,1)
  20:    10100  (2,3)
  21:    10101  (2,2,1)
  23:    10111  (2,1,1,1)
		

Crossrefs

The version for runs in binary expansion is A175413.
The version for parts instead of run-sums is A233564, counted A032020.
The version for run-lengths instead of run-sums is A351596, counted A329739.
The version for runs instead of run-sums is A351290, counted by A351013.
The version for partitions is A353838, counted A353837, complement A353839.
The equal instead of distinct version is A353848, counted by A353851.
These compositions are counted by A353850.
The weak version (rucksack compositions) is A354581, counted by A354580.
A003242 counts anti-run compositions, ranked by A333489.
A005811 counts runs in binary expansion.
A011782 counts compositions.
A242882 counts composition with distinct multiplicities, partitions A098859.
A304442 counts partitions with all equal run-sums.
A351014 counts distinct runs in standard compositions, firsts A351015.
A353853-A353859 pertain to composition run-sum trajectory.
A353864 counts rucksack partitions, perfect A353865.
A353929 counts distinct runs in binary expansion, firsts A353930.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,100],UnsameQ@@Total/@Split[stc[#]]&]

A353851 Number of integer compositions of n with all equal run-sums.

Original entry on oeis.org

1, 1, 2, 2, 5, 2, 8, 2, 12, 5, 8, 2, 34, 2, 8, 8, 43, 2, 52, 2, 70, 8, 8, 2, 282, 5, 8, 18, 214, 2, 386, 2, 520, 8, 8, 8, 1957, 2, 8, 8, 2010, 2, 2978, 2, 3094, 94, 8, 2, 16764, 5, 340, 8, 12310, 2, 26514, 8, 27642, 8, 8, 2, 132938, 2, 8, 238, 107411, 8, 236258
Offset: 0

Views

Author

Gus Wiseman, May 31 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 a(0) = 1 through a(8) = 12 compositions:
  ()  (1)  (2)   (3)    (4)     (5)      (6)       (7)        (8)
           (11)  (111)  (22)    (11111)  (33)      (1111111)  (44)
                        (112)            (222)                (224)
                        (211)            (1113)               (422)
                        (1111)           (2112)               (2222)
                                         (3111)               (11114)
                                         (11211)              (41111)
                                         (111111)             (111122)
                                                              (112112)
                                                              (211211)
                                                              (221111)
                                                              (11111111)
For example:
  (1,1,2,1,1) has run-sums (2,2,2) so is counted under a(6).
  (4,1,1,1,1,2,2) has run-sums (4,4,4) so is counted under a(12).
  (3,3,2,2,2) has run-sums (6,6) so is counted under a(12).
		

Crossrefs

The version for parts or runs instead of run-sums is A000005.
The version for multiplicities instead of run-sums is A098504.
All parts are divisors of n, see A100346.
The version for partitions is A304442, ranked by A353833.
The version for run-lengths instead of run-sums is A329738, ptns A047966.
These compositions are ranked by A353848.
The distinct instead of equal version is A353850.
A003242 counts anti-run compositions, ranked by A333489.
A005811 counts runs in binary expansion.
A011782 counts compositions.
A353847 represents the composition run-sum transformation.
For distinct instead of equal run-sums: A032020, A098859, A242882, A329739, A351013, A353837, ranked by A353838 (complement A353839), A353852, A354580, ranked by A354581.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@ IntegerPartitions[n],SameQ@@Total/@Split[#]&]],{n,0,15}]
  • PARI
    a(n) = {if(n <=1, return(1)); my(d = divisors(n), res = 0); for(i = 1, #d, nd = numdiv(d[i]); res+=(nd*(nd-1)^(n/d[i]-1)) ); res } \\ David A. Corneth, Jun 02 2022

Formula

From David A. Corneth, Jun 02 2022 (Start)
a(p) = 2 for prime p.
a(p*q) = 8 for distinct primes p and q (Cf. A006881).
a(n) = Sum_{d|n} tau(d)*(tau(d)-1) ^ (n/d - 1) where tau = A000005. (End)

Extensions

More terms from David A. Corneth, Jun 02 2022

A353849 Number of distinct positive run-sums of the n-th composition in standard order.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, May 30 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).
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.

Examples

			Composition 462903 in standard order is (1,1,4,7,1,2,1,1,1), with run-sums (2,4,7,1,2,3), of which a(462903) = 5 are distinct.
		

Crossrefs

Counting repeated runs also gives A124767.
Positions of first appearances are A246534.
For distinct runs instead of run-sums we have A351014 (firsts A351015).
A version for partitions is A353835, weak A353861.
Positions of 1's are A353848, counted by A353851.
The version for binary expansion is A353929 (firsts A353930).
The run-sums themselves are listed by A353932, with A353849 distinct terms.
For distinct run-lengths instead of run-sums we have A354579.
A005811 counts runs in binary expansion.
A066099 lists compositions in standard order.
A165413 counts distinct run-lengths in binary expansion.
A297770 counts distinct runs in binary expansion, firsts A350952.
A353847 represents the run-sum transformation for compositions.
A353853-A353859 pertain to composition run-sum trajectory.
Selected statistics of standard compositions:
- Length is A000120.
- Sum is A070939.
- Heinz number is A333219.
- Number of distinct parts is A334028.
Selected classes of standard compositions:
- Partitions are A114994, strict A333256.
- Multisets are A225620, strict A333255.
- Strict compositions are A233564.
- Constant compositions are A272919.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[Length[Union[Total/@Split[stc[n]]]],{n,0,100}]
Showing 1-10 of 44 results. Next