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.

A374249 Numbers k such that the k-th composition in standard order has its equal parts contiguous.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jul 13 2024

Keywords

Comments

These are compositions avoiding the patterns (1,2,1) and (2,1,2).
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

			The terms together with their standard compositions begin:
   0: ()
   1: (1)
   2: (2)
   3: (1,1)
   4: (3)
   5: (2,1)
   6: (1,2)
   7: (1,1,1)
   8: (4)
   9: (3,1)
  10: (2,2)
  11: (2,1,1)
  12: (1,3)
  14: (1,1,2)
  15: (1,1,1,1)
  16: (5)
See A374253 for the complement: 13, 22, 25, 27, 29, ...
		

Crossrefs

The strict (also anti-run) case is A233564, counted by A032020.
Compositions of this type are counted by A274174.
Permutations of prime indices of this type are counted by A333175.
The complement is A374253 (anti-run A374254), counted by A335548.
A003242 counts anti-run compositions, ranks A333489.
A011782 counts compositions.
A066099 lists compositions in standard order.
A124767 counts runs in standard compositions, anti-runs A333381.
A333755 counts compositions by number of runs.
A335454 counts patterns matched by standard compositions.
A335462 counts (1,2,1)- and (2,1,2)-matching permutations of prime indices.
- A335470 counts (1,2,1)-matching compositions, ranks A335466.
- A335471 counts (1,2,1)-avoiding compositions, ranks A335467.
- A335472 counts (2,1,2)-matching compositions, ranks A335468.
- A335473 counts (2,1,2)-avoiding compositions, ranks A335469.

Programs

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

Formula

Equals A335467 /\ A335469.

A374701 Numbers k such that the leaders of weakly decreasing runs in the k-th composition in standard order (A066099) are distinct.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 47, 48, 49, 50, 51, 52, 53, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71
Offset: 1

Views

Author

Gus Wiseman, Jul 24 2024

Keywords

Comments

First differs from A335469 in having 150, which corresponds to the composition (3,2,1,2).
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

			The maximal weakly decreasing subsequences of the 1257th composition in standard order are ((3,1,1),(2),(3,1)), with leaders (3,2,3), so 1257 is not in the sequence.
		

Crossrefs

Positions of distinct (strict) rows in A374740, opposite A374629.
Compositions of this type are counted by A374743.
For identical leaders we have A374744, counted by A374742.
Other types of runs and their counts: A374249 (A274174), A374638 (A374518), A374698 (A374687), A374767 (A374761), A374768 (A374632).
A011782 counts compositions.
A238130, A238279, A333755 count compositions by number of runs.
A335456 counts patterns matched by compositions.
A373949 counts compositions by run-compressed sum.
All of the following pertain to compositions in standard order:
- Length is A000120.
- Sum is A029837(n+1) (or sometimes A070939).
- Parts are listed by A066099.
- Adjacent equal pairs are counted by A124762, unequal A333382.
- Number of max runs: A124765, A124766, A124767, A124768, A124769, A333381.
- Ranks of anti-run compositions are A333489, counted by A003242.
- Run-length transform is A333627.
- Run-compression transform is A373948, sum A373953, excess A373954.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,100],UnsameQ@@First/@Split[stc[#],GreaterEqual]&] (* Gus Wiseman, Jul 24 2024 *)

A374253 Numbers k such that the k-th composition in standard order matches the patterns (1,2,1) or (2,1,2).

Original entry on oeis.org

13, 22, 25, 27, 29, 45, 46, 49, 51, 53, 54, 55, 57, 59, 61, 76, 77, 82, 86, 89, 90, 91, 93, 94, 97, 99, 101, 102, 103, 105, 107, 108, 109, 110, 111, 113, 115, 117, 118, 119, 121, 123, 125, 141, 148, 150, 153, 155, 156, 157, 162, 165, 166, 173, 174, 177, 178
Offset: 1

Views

Author

Gus Wiseman, Jul 13 2024

Keywords

Comments

Such a composition cannot be strict.
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

			The terms together with their standard compositions begin:
  13: (1,2,1)
  22: (2,1,2)
  25: (1,3,1)
  27: (1,2,1,1)
  29: (1,1,2,1)
  45: (2,1,2,1)
  46: (2,1,1,2)
  49: (1,4,1)
  51: (1,3,1,1)
  53: (1,2,2,1)
  54: (1,2,1,2)
  55: (1,2,1,1,1)
  57: (1,1,3,1)
  59: (1,1,2,1,1)
  61: (1,1,1,2,1)
  76: (3,1,3)
  77: (3,1,2,1)
  82: (2,3,2)
  86: (2,2,1,2)
  89: (2,1,3,1)
		

Crossrefs

Permutations of prime indices of this type are counted by A335460.
Compositions of this type are counted by A335548.
The complement is A374249, counted by A274174.
The anti-run case is A374254.
A003242 counts anti-run compositions, ranks A333489.
A011782 counts compositions.
A025047 counts wiggly compositions, ranks A345167.
A066099 lists compositions in standard order.
A124767 counts runs in standard compositions, anti-runs A333381.
A233564 ranks strict compositions, counted by A032020.
A333755 counts compositions by number of runs.
A335454 counts patterns matched by standard compositions.
A335456 counts patterns matched by compositions.
A335462 counts (1,2,1)- and (2,1,2)-matching permutations of prime indices.
A335465 counts minimal patterns avoided by a standard composition.
- A335470 counts (1,2,1)-matching compositions, ranks A335466.
- A335471 counts (1,2,1)-avoiding compositions, ranks A335467.
- A335472 counts (2,1,2)-matching compositions, ranks A335468.
- A335473 counts (2,1,2)-avoiding compositions, ranks A335469.
A373948 encodes run-compression using compositions in standard order.
A373949 counts compositions by run-compressed sum, opposite A373951.
A373953 gives run-compressed sum of standard compositions, excess A373954.

Programs

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

Formula

Equals A335466 \/ A335468.

A335473 Number of compositions of n avoiding the pattern (2,1,2).

Original entry on oeis.org

1, 1, 2, 4, 8, 15, 29, 55, 103, 190, 347, 630, 1134, 2028, 3585, 6291, 10950, 18944, 32574, 55692, 94618, 159758, 268147, 447502, 743097, 1227910, 2020110, 3308302, 5394617, 8757108, 14155386, 22784542, 36529813, 58343498, 92850871, 147254007, 232750871, 366671436
Offset: 0

Views

Author

Gus Wiseman, Jun 17 2020

Keywords

Comments

Also the number of (1,2,2) or (2,2,1)-avoiding compositions.
We define a pattern to be a finite sequence covering an initial interval of positive integers. Patterns are counted by A000670 and ranked by A333217. A sequence S is said to match a pattern P if there is a not necessarily contiguous subsequence of S whose parts have the same relative order as P. For example, (3,1,1,3) matches (1,1,2), (2,1,1), and (2,1,2), but avoids (1,2,1), (1,2,2), and (2,2,1).
A composition of n is a finite sequence of positive integers summing to n.

Examples

			The a(0) = 1 through a(5) = 15 compositions:
  ()  (1)  (2)   (3)    (4)     (5)
           (11)  (12)   (13)    (14)
                 (21)   (22)    (23)
                 (111)  (31)    (32)
                        (112)   (41)
                        (121)   (113)
                        (211)   (122)
                        (1111)  (131)
                                (221)
                                (311)
                                (1112)
                                (1121)
                                (1211)
                                (2111)
                                (11111)
		

Crossrefs

The version for patterns is A001710.
The version for prime indices is A335450.
These compositions are ranked by A335469.
The (1,2,1)-avoiding version is A335471.
The complement A335472 is the matching version.
Constant patterns are counted by A000005 and ranked by A272919.
Permutations are counted by A000142 and ranked by A333218.
Patterns are counted by A000670 and ranked by A333217.
Compositions are counted by A011782.
Compositions avoiding (1,2,3) are counted by A102726.
Non-unimodal compositions are counted by A115981 and ranked by A335373.
Combinatory separations are counted by A269134.
Patterns matched by compositions are counted by A335456.
Minimal patterns avoided by a standard composition are counted by A335465.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],!MatchQ[#,{_,x_,_,y_,_,x_,_}/;x>y]&]],{n,0,10}]
  • PARI
    a(n)={local(Cache=Map()); my(F(n,m,k) = if(m>n, n==0, my(hk=[n,m,k], z); if(!mapisdefined(Cache,hk,&z), z=self()(n,m+1,k) + k*sum(i=1,n\m, self()(n-i*m, m+1, k+i)); mapput(Cache, hk, z)); z)); F(n,1,1)} \\ Andrew Howroyd, Dec 31 2020

Formula

a(n > 0) = 2^(n - 1) - A335472(n).
a(n) = F(n,1,1) where F(n,m,k) = F(n,m+1,k) + k*(Sum_{i=1..floor(n/m)} F(n-i*m, m+1, k+i)) for m <= n with F(0,m,k)=1 and F(n,m,k)=0 otherwise. - Andrew Howroyd, Dec 31 2020

Extensions

Terms a(21) and beyond from Andrew Howroyd, Dec 31 2020

A335467 Numbers k such that the k-th composition in standard order (A066099) avoids the pattern (1,2,1).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 26, 28, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 46, 47, 48, 50, 52, 56, 58, 60, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 78, 79, 80, 81
Offset: 1

Views

Author

Gus Wiseman, Jun 16 2020

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n. 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.
We define a pattern to be a finite sequence covering an initial interval of positive integers. Patterns are counted by A000670 and ranked by A333217. A sequence S is said to match a pattern P if there is a not necessarily contiguous subsequence of S whose parts have the same relative order as P. For example, (3,1,1,3) matches (1,1,2), (2,1,1), and (2,1,2), but avoids (1,2,1), (1,2,2), and (2,2,1).

Examples

			See A335466 for an example of the complement.
		

Crossrefs

The complement A335466 is the matching version.
The (2,1,2)-avoiding version is A335469.
These compositions are counted by A335471.
Constant patterns are counted by A000005 and ranked by A272919.
Permutations are counted by A000142 and ranked by A333218.
Patterns are counted by A000670 and ranked by A333217.
Non-unimodal compositions are counted by A115981 and ranked by A335373.
Combinatory separations are counted by A269134 and ranked by A334030.
Patterns matched by standard compositions are counted by A335454.
Minimal patterns avoided by a standard composition are counted by A335465.

Programs

  • Mathematica
    stc[n_]:=Reverse[Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]];
    Select[Range[0,100],!MatchQ[stc[#],{_,x_,_,y_,_,x_,_}/;x
    				

A335450 Number of (2,1,2)-avoiding permutations of the prime indices of n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jun 14 2020

Keywords

Comments

Depends only on unsorted prime signature (A124010), but not only on sorted prime signature (A118914).
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.
We define a pattern to be a finite sequence covering an initial interval of positive integers. Patterns are counted by A000670. A sequence S is said to match a pattern P if there is a not necessarily contiguous subsequence of S whose parts have the same relative order as P. For example, (3,1,1,3) matches (1,1,2), (2,1,1), and (2,1,2), but avoids (1,2,1), (1,2,2), and (2,2,1).

Examples

			The permutations for n = 2, 6, 12, 24, 30, 48, 60, 90:
  (1)  (12)  (112)  (1112)  (123)  (11112)  (1123)  (1223)
       (21)  (211)  (2111)  (132)  (21111)  (1132)  (1322)
                            (213)           (2113)  (2123)
                            (231)           (2311)  (2213)
                            (312)           (3112)  (2231)
                            (321)           (3211)  (3122)
                                                    (3212)
                                                    (3221)
		

Crossrefs

Positions of ones are A000961.
Replacing (2,1,2) with (1,2,1) gives A335449.
The matching version is A335453.
Patterns are counted by A000670.
(2,1,2)-avoiding patterns are counted by A001710.
Permutations of prime indices are counted by A008480.
Unsorted prime signature is A124010. Sorted prime signature is A118914.
(1,2,1) and (2,1,2)-avoiding permutations of prime indices are A333175.
STC-numbers of permutations of prime indices are A333221.
(1,2,1) and (2,1,2)-avoiding permutations of prime indices are A335448.
Patterns matched by standard compositions are counted by A335454.
(1,2,1) or (2,1,2)-matching permutations of prime indices are A335460.
(1,2,1) and (2,1,2)-matching permutations of prime indices are A335462.
Dimensions of downsets of standard compositions are A335465.
(2,1,2)-avoiding compositions are ranked by A335469.
(2,1,2)-avoiding compositions are counted by A335473.
(2,2,1)-avoiding compositions are ranked by A335524.
(1,2,2)-avoiding compositions are ranked by A335525.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Table[Length[Select[Permutations[primeMS[n]],!MatchQ[#,{_,x_,_,y_,_,x_,_}/;x>y]&]],{n,100}]

A335468 Numbers k such that the k-th composition in standard order (A066099) matches the pattern (2,1,2).

Original entry on oeis.org

22, 45, 46, 54, 76, 86, 90, 91, 93, 94, 109, 110, 118, 148, 150, 153, 156, 166, 173, 174, 178, 180, 181, 182, 183, 186, 187, 189, 190, 204, 214, 218, 219, 221, 222, 237, 238, 246, 278, 280, 297, 300, 301, 302, 306, 307, 308, 310, 313, 316, 326, 332, 333, 334
Offset: 1

Views

Author

Gus Wiseman, Jun 16 2020

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n. 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.
We define a pattern to be a finite sequence covering an initial interval of positive integers. Patterns are counted by A000670 and ranked by A333217. A sequence S is said to match a pattern P if there is a not necessarily contiguous subsequence of S whose parts have the same relative order as P. For example, (3,1,1,3) matches (1,1,2), (2,1,1), and (2,1,2), but avoids (1,2,1), (1,2,2), and (2,2,1).

Examples

			The sequence together with the corresponding compositions begins:
   22: (2,1,2)
   45: (2,1,2,1)
   46: (2,1,1,2)
   54: (1,2,1,2)
   76: (3,1,3)
   86: (2,2,1,2)
   90: (2,1,2,2)
   91: (2,1,2,1,1)
   93: (2,1,1,2,1)
   94: (2,1,1,1,2)
  109: (1,2,1,2,1)
  110: (1,2,1,1,2)
  118: (1,1,2,1,2)
  148: (3,2,3)
  150: (3,2,1,2)
		

Crossrefs

The complement A335469 is the avoiding version.
The (1,2,1)-matching version is A335466.
These compositions are counted by A335472.
Constant patterns are counted by A000005 and ranked by A272919.
Permutations are counted by A000142 and ranked by A333218.
Patterns are counted by A000670 and ranked by A333217.
Non-unimodal compositions are counted by A115981 and ranked by A335373.
Combinatory separations are counted by A269134 and ranked by A334030.
Patterns matched by standard compositions are counted by A335454.
Minimal patterns avoided by a standard composition are counted by A335465.

Programs

  • Mathematica
    stc[n_]:=Reverse[Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]];
    Select[Range[0,100],MatchQ[stc[#],{_,x_,_,y_,_,x_,_}/;x>y]&];

A374254 Numbers k such that the k-th composition in standard order is an anti-run and matches the patterns (1,2,1) or (2,1,2).

Original entry on oeis.org

13, 22, 25, 45, 49, 54, 76, 77, 82, 89, 97, 101, 102, 105, 108, 109, 141, 148, 150, 153, 162, 165, 166, 177, 178, 180, 182, 193, 197, 198, 204, 205, 209, 210, 216, 217, 269, 278, 280, 281, 297, 300, 301, 305, 306, 308, 310, 322, 325, 326, 332, 333, 353, 354
Offset: 1

Views

Author

Gus Wiseman, Jul 14 2024

Keywords

Comments

Such a composition cannot be strict.
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

			The terms together with their standard compositions begin:
   13: (1,2,1)
   22: (2,1,2)
   25: (1,3,1)
   45: (2,1,2,1)
   49: (1,4,1)
   54: (1,2,1,2)
   76: (3,1,3)
   77: (3,1,2,1)
   82: (2,3,2)
   89: (2,1,3,1)
   97: (1,5,1)
  101: (1,3,2,1)
  102: (1,3,1,2)
  105: (1,2,3,1)
  108: (1,2,1,3)
  109: (1,2,1,2,1)
  141: (4,1,2,1)
  148: (3,2,3)
  150: (3,2,1,2)
  153: (3,1,3,1)
		

Crossrefs

Compositions of this type are counted by A285981.
Permutations of prime indices of this type are counted by A335460.
This is the anti-run complement case of A374249, counted by A274174.
This is the anti-run case of A374253, counted by A335548.
A003242 counts anti-run compositions, ranks A333489.
A011782 counts compositions.
A025047 counts wiggly compositions, ranks A345167.
A066099 lists compositions in standard order.
A124767 counts runs in standard compositions, anti-runs A333381.
A233564 ranks strict compositions, counted by A032020.
A333755 counts compositions by number of runs.
A335454 counts patterns matched by standard compositions.
A335456 counts patterns matched by compositions.
A335462 counts (1,2,1)- and (2,1,2)-matching permutations of prime indices.
A335465 counts minimal patterns avoided by a standard composition.
- A335470 counts (1,2,1)-matching compositions, ranks A335466.
- A335471 counts (1,2,1)-avoiding compositions, ranks A335467.
- A335472 counts (2,1,2)-matching compositions, ranks A335468.
- A335473 counts (2,1,2)-avoiding compositions, ranks A335469.
A373948 encodes run-compression using compositions in standard order.
A373949 counts compositions by run-compressed sum, opposite A373951.
A373953 gives run-compressed sum of standard compositions, excess A373954.

Programs

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

Formula

Equals A333489 /\ A374253.
Showing 1-8 of 8 results.