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

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

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[#]]&]

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}]

A353853 Trajectory of the composition run-sum transformation (or condensation) of n, using standard composition numbers.

Original entry on oeis.org

0, 1, 2, 3, 2, 4, 5, 6, 7, 4, 8, 9, 10, 8, 11, 10, 8, 12, 13, 14, 10, 8, 15, 8, 16, 17, 18, 19, 18, 20, 21, 17, 22, 23, 20, 24, 25, 26, 24, 27, 26, 24, 28, 20, 29, 21, 17, 30, 18, 31, 16, 32, 33, 34, 35, 34, 36, 32, 37, 38, 39, 36, 32, 40, 41, 42, 32
Offset: 0

Views

Author

Gus Wiseman, Jun 01 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.
The run-sum trajectory is obtained by repeatedly taking the run-sum transformation (A353847) until the rank of an anti-run is reached. For example, the trajectory 11 -> 10 -> 8 given in row 11 corresponds to the trajectory (2,1,1) -> (2,2) -> (4).

Examples

			Triangle begins:
   0
   1
   2
   3  2
   4
   5
   6
   7  4
   8
   9
  10  8
  11 10  8
  12
  13
  14 10  8
For example, the trajectory of 29 is 29 -> 21 -> 17, corresponding to the compositions (1,1,2,1) -> (2,2,1) -> (4,1).
		

Crossrefs

These sequences for partitions are A353840-A353846.
This is the iteration of A353847, with partition version A353832.
Row-lengths are A353854, counted by A353859.
Final terms are A353855.
Counting rows by weight of final term gives A353856.
Rows ending in a power of 2 are A353857, counted by A353858.
A003242 counts anti-run compositions, ranked by A333489, complement A261983.
A005811 counts runs in binary expansion.
A011782 counts compositions.
A066099 lists compositions in standard order.
A318928 gives runs-resistance of binary expansion.
A329739 counts compositions with all distinct run-lengths.
A333627 ranks the run-lengths of standard compositions.
A351014 counts distinct runs in standard compositions, firsts A351015.
A353853-A353859 pertain to composition run-sum trajectory.
A353929 counts distinct runs in binary expansion, firsts A353930.
A353932 lists run-sums of standard compositions.

Programs

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

A353861 Number of distinct weak run-sums of the prime indices of n.

Original entry on oeis.org

1, 2, 2, 3, 2, 3, 2, 4, 3, 3, 2, 3, 2, 3, 3, 5, 2, 4, 2, 4, 3, 3, 2, 4, 3, 3, 4, 4, 2, 4, 2, 6, 3, 3, 3, 4, 2, 3, 3, 4, 2, 4, 2, 4, 4, 3, 2, 5, 3, 4, 3, 4, 2, 5, 3, 5, 3, 3, 2, 4, 2, 3, 3, 7, 3, 4, 2, 4, 3, 4, 2, 5, 2, 3, 4, 4, 3, 4, 2, 5, 5, 3, 2, 4, 3, 3, 3, 5, 2, 5, 3, 4, 3, 3, 3, 6, 2, 4, 4, 5, 2, 4, 2, 5, 4, 3, 2, 5
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.
A weak run-sum of a sequence is the sum of any consecutive constant subsequence.

Examples

			The prime indices of 72 are {1,1,1,2,2}, with weak runs {}, {1}, {1,1}, {1,1,1}, {2}, {2,2}, which have sums 0, 1, 2, 3, 2, 4, of which 5 are distinct, so a(72) = 5.
		

Crossrefs

Positions of 2's are A000040.
Positions of first appearances are A000079.
The strong version is A353835, firsts A002110.
Partitions with distinct run-sums are ranked by A353838, counted by A353837.
The strong version for compositions is A353849.
The greatest run-sum is given by A353862, least A353931.
A001222 counts prime factors, distinct A001221.
A005811 counts runs in binary expansion.
A056239 adds up prime indices, row sums of A112798 and A296150.
A124010 gives prime signature, sorted A118914.
A165413 counts distinct run-lengths in binary expansion, sums A353929.
A300273 ranks collapsible partitions, counted by A275870.
A353832 represents taking run-sums of a partition, compositions A353847.
A353833 ranks partitions with all equal run-sums, counted by A304442.
A353840-A353846 pertain to partition run-sum trajectory.
A353852 ranks compositions with all distinct run-sums, counted by A353850.

Programs

  • Mathematica
    Table[Length[Union@@Cases[FactorInteger[n],{p_,k_}:>Range[0,k]*PrimePi[p]]],{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); };
    A353861(n) = if(1==n,n,my(pruns = pis_to_runs(n), runsum = 0, runsums = List([])); for(i=1,#pruns, listput(runsums, runsum); if((i>1) && pruns[i] == pruns[i-1], runsum += pruns[i], runsum = pruns[i])); listput(runsums, runsum); #Set(runsums)); \\ Antti Karttunen, Jan 20 2025

Extensions

Data section extended to a(108) by Antti Karttunen, Jan 20 2025

A353863 Number of integer partitions of n whose weak run-sums cover an initial interval of nonnegative integers.

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 4, 6, 7, 10, 11, 16, 20, 24, 30, 43, 47, 62, 79, 94, 113, 143, 170, 211, 256, 307, 372, 449, 531, 648, 779, 926, 1100, 1323, 1562, 1864, 2190, 2595, 3053, 3611, 4242, 4977, 5834, 6825, 7973, 9344, 10844, 12641, 14699, 17072, 19822
Offset: 0

Views

Author

Gus Wiseman, Jun 04 2022

Keywords

Comments

A weak run-sum of a sequence is the sum of any consecutive constant subsequence. For example, the weak run-sums of (3,2,2,1) are {1,2,3,4}.
This is a kind of completeness property, cf. A126796.

Examples

			The a(1) = 1 through a(8) = 7 partitions:
  (1)  (11)  (21)   (211)   (311)    (321)     (3211)     (3221)
             (111)  (1111)  (2111)   (3111)    (4111)     (32111)
                            (11111)  (21111)   (22111)    (41111)
                                     (111111)  (31111)    (221111)
                                               (211111)   (311111)
                                               (1111111)  (2111111)
                                                          (11111111)
		

Crossrefs

For parts instead of weak run-sums we have A000009.
For multiplicities instead of weak run-sums we have A317081.
If weak run-sums are distinct we have A353865, the completion of A353864.
A003242 counts anti-run compositions, ranked by A333489, complement A261983.
A005811 counts runs in binary expansion.
A165413 counts distinct run-lengths in binary expansion, sums A353929.
A300273 ranks collapsible partitions, counted by A275870, comps A353860.
A353832 represents taking run-sums of a partition, compositions A353847.
A353833 ranks partitions with all equal run-sums, counted by A304442.
A353835 counts distinct run-sums of prime indices.
A353837 counts partitions with distinct run-sums, ranked by A353838.
A353840-A353846 pertain to partition run-sum trajectory.
A353861 counts distinct weak run-sums of prime indices.
A353932 lists run-sums of standard compositions.

Programs

  • Mathematica
    normQ[m_]:=m=={}||Union[m]==Range[Max[m]];
    msubs[s_]:=Join@@@Tuples[Table[Take[t,i],{t,Split[s]},{i,0,Length[t]}]];
    wkrs[y_]:=Union[Total/@Select[msubs[y],SameQ@@#&]];
    Table[Length[Select[IntegerPartitions[n],normQ[Rest[wkrs[#]]]&]],{n,0,15}]
  • PARI
    \\ isok(p) tests the partition.
    isok(p)={my(b=0, s=0, t=0); for(i=1, #p, if(p[i]<>t, t=p[i]; s=0); s += t; b = bitor(b, 1<<(s-1))); bitand(b,b+1)==0}
    a(n) = {my(r=0); forpart(p=n, r+=isok(p)); r} \\ Andrew Howroyd, Jan 15 2024

Extensions

a(31) onwards from Andrew Howroyd, Jan 15 2024

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
Showing 1-7 of 7 results.