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 23 results. Next

A345192 Number of non-alternating compositions of n.

Original entry on oeis.org

0, 0, 1, 1, 4, 9, 20, 45, 99, 208, 437, 906, 1862, 3803, 7732, 15659, 31629, 63747, 128258, 257722, 517339, 1037652, 2079984, 4167325, 8346204, 16710572, 33449695, 66944254, 133959021, 268028868, 536231903, 1072737537, 2145905285, 4292486690, 8586035993, 17173742032, 34350108745, 68704342523, 137415168084
Offset: 0

Views

Author

Gus Wiseman, Jun 17 2021

Keywords

Comments

First differs from A261983 at a(6) = 20, A261983(6) = 18.
A sequence is alternating if it is alternately strictly increasing and strictly decreasing, starting with either. For example, the partition (3,2,2,2,1) has no alternating permutations, even though it does have the anti-run permutations (2,3,2,1,2) and (2,1,2,3,2).

Examples

			The a(2) = 1 through a(6) = 20 compositions:
  (11)  (111)  (22)    (113)    (33)
               (112)   (122)    (114)
               (211)   (221)    (123)
               (1111)  (311)    (222)
                       (1112)   (321)
                       (1121)   (411)
                       (1211)   (1113)
                       (2111)   (1122)
                       (11111)  (1131)
                                (1221)
                                (1311)
                                (2112)
                                (2211)
                                (3111)
                                (11112)
                                (11121)
                                (11211)
                                (12111)
                                (21111)
                                (111111)
		

Crossrefs

The complement is counted by A025047 (ascend: A025048, descend: A025049).
Dominates A261983 (non-anti-run compositions), ranked by A348612.
These compositions are ranked by A345168, complement A345167.
The case without twins is A348377.
The version for factorizations is A348613.
A001250 counts alternating permutations, complement A348615.
A003242 counts anti-run compositions.
A011782 counts compositions.
A032020 counts strict compositions.
A106356 counts compositions by number of maximal anti-runs.
A114901 counts compositions where each part is adjacent to an equal part.
A274174 counts compositions with equal parts contiguous.
A325534 counts separable partitions, ranked by A335433.
A325535 counts inseparable partitions, ranked by A335448.
A344604 counts alternating compositions with twins.
A344605 counts alternating patterns with twins.
A344654 counts non-twin partitions with no alternating permutation.
A345162 counts normal partitions with no alternating permutation.
A345164 counts alternating permutations of prime indices.
A345170 counts partitions w/ alternating permutation, ranked by A345172.
A345165 counts partitions w/o alternating permutation, ranked by A345171.
Patterns:
- A128761 avoiding (1,2,3) adjacent.
- A344614 avoiding (1,2,3) and (3,2,1) adjacent.
- A344615 weakly avoiding (1,2,3) adjacent.

Programs

  • Mathematica
    wigQ[y_]:=Or[Length[y]==0,Length[Split[y]]== Length[y]&&Length[Split[Sign[Differences[y]]]]==Length[y]-1];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],!wigQ[#]&]],{n,0,15}]

Formula

a(n) = A011782(n) - A025047(n).

A344653 Every permutation of the prime factors of n has a consecutive monotone triple, i.e., a triple (..., x, y, z, ...) such that either x <= y <= z or x >= y >= z.

Original entry on oeis.org

8, 16, 24, 27, 32, 40, 48, 54, 56, 64, 80, 81, 88, 96, 104, 112, 125, 128, 135, 136, 144, 152, 160, 162, 176, 184, 189, 192, 208, 224, 232, 240, 243, 248, 250, 256, 270, 272, 288, 296, 297, 304, 320, 324, 328, 336, 343, 344, 351, 352, 368, 375, 376, 378, 384
Offset: 1

Views

Author

Gus Wiseman, Jun 12 2021

Keywords

Comments

Differs from A335448 in lacking squares and having 270 etc.
First differs from A345193 in having 270.
Such a permutation is characterized by being neither a twin (x,x) nor wiggly (A025047, A345192). A sequence is wiggly if it is alternately strictly increasing and strictly decreasing, starting with either. For example, the partition (3,2,2,2,1) has no wiggly permutations, even though it has anti-run permutations (2,3,2,1,2) and (2,1,2,3,2).
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.

Examples

			The sequence of terms together with their prime indices begins:
   8: {1,1,1}
  16: {1,1,1,1}
  24: {1,1,1,2}
  27: {2,2,2}
  32: {1,1,1,1,1}
  40: {1,1,1,3}
  48: {1,1,1,1,2}
  54: {1,2,2,2}
  56: {1,1,1,4}
  64: {1,1,1,1,1,1}
  80: {1,1,1,1,3}
  81: {2,2,2,2}
  88: {1,1,1,5}
  96: {1,1,1,1,1,2}
For example, 36 has prime indices (1,1,2,2), which has the two wiggly permutations (1,2,1,2) and (2,1,2,1), so 36 is not in the sequence.
		

Crossrefs

A superset of A335448, counted by A325535.
Positions of 0's in A344606.
These partitions are counted by A344654.
The complement is A344742, counted by A344740.
The separable case is A345173, counted by A345166.
A000041 counts partitions of 2n with alternating sum 0, ranked by A000290.
A001250 counts wiggly permutations.
A003242 counts anti-run compositions.
A025047 counts wiggly compositions (ascend: A025048, descend: A025049).
A325534 counts separable partitions, ranked by A335433.
A344604 counts wiggly compositions with twins.
A345164 counts wiggly permutations of prime indices.
A345165 counts partitions without a wiggly permutation, ranked by A345171.
A345170 counts partitions with a wiggly permutation, ranked by A345172.
A345192 counts non-wiggly compositions.

Programs

  • Mathematica
    Select[Range[100],Select[Permutations[Flatten[ConstantArray@@@FactorInteger[#]]],!MatchQ[#,{_,x_,y_,z_,_}/;x<=y<=z||x>=y>=z]&]=={}&]

Formula

Complement of A001248 in A345171.

A345172 Numbers whose multiset of prime factors has an alternating permutation.

Original entry on oeis.org

1, 2, 3, 5, 6, 7, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 26, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 50, 51, 52, 53, 55, 57, 58, 59, 60, 61, 62, 63, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 82, 83
Offset: 1

Views

Author

Gus Wiseman, Jun 13 2021

Keywords

Comments

First differs from A212167 in containing 72.
First differs from A335433 in lacking 270, corresponding to the partition (3,2,2,2,1).
A sequence is alternating if it is alternately strictly increasing and strictly decreasing, starting with either. For example, the partition (3,3,2,2,2,2,1) has no alternating permutations, even though it has the anti-run permutations (2,3,2,3,2,1,2), (2,3,2,1,2,3,2), and (2,1,2,3,2,3,2).
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.

Examples

			The sequence of terms together with their prime indices begins:
      1: {}          20: {1,1,3}       39: {2,6}
      2: {1}         21: {2,4}         41: {13}
      3: {2}         22: {1,5}         42: {1,2,4}
      5: {3}         23: {9}           43: {14}
      6: {1,2}       26: {1,6}         44: {1,1,5}
      7: {4}         28: {1,1,4}       45: {2,2,3}
     10: {1,3}       29: {10}          46: {1,9}
     11: {5}         30: {1,2,3}       47: {15}
     12: {1,1,2}     31: {11}          50: {1,3,3}
     13: {6}         33: {2,5}         51: {2,7}
     14: {1,4}       34: {1,7}         52: {1,1,6}
     15: {2,3}       35: {3,4}         53: {16}
     17: {7}         36: {1,1,2,2}     55: {3,5}
     18: {1,2,2}     37: {12}          57: {2,8}
     19: {8}         38: {1,8}         58: {1,10}
		

Crossrefs

Including squares of primes A001248 gives A344742, counted by A344740.
This is a subset of A335433, which is counted by A325534.
Positions of nonzero terms in A345164.
The partitions with these Heinz numbers are counted by A345170.
The complement is A345171, which is counted by A345165.
A345173 = A345171 /\ A335433 is counted by A345166.
A000041 counts partitions of 2n with alternating sum 0, ranked by A000290.
A001250 counts alternating permutations.
A003242 counts anti-run compositions.
A025047 counts alternating or wiggly compositions, also A025048, A025049.
A325535 counts inseparable partitions, ranked by A335448.
A344604 counts alternating compositions with twins.
A344606 counts alternating permutations of prime indices with twins.
A345192 counts non-alternating compositions.

Programs

  • Mathematica
    wigQ[y_]:=Length[Split[y]]== Length[y]&&Length[Split[Sign[Differences[y]]]]==Length[y]-1;
    Select[Range[100],Select[Permutations[ Flatten[ConstantArray@@@FactorInteger[#]]],wigQ[#]&]!={}&]

Formula

Complement of A001248 (squares of primes) in A344742.

A345164 Number of alternating permutations of the multiset of prime factors of n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jun 13 2021

Keywords

Comments

First differs from A335452 at a(30) = 4, A335452(30) = 6. The anti-runs (2,3,5) and (5,3,2) are not alternating.
A sequence is alternating if it is alternately strictly increasing and strictly decreasing, starting with either. For example, the partition (3,2,2,2,1) has no alternating permutation, even though it does have the anti-run permutations (2,3,2,1,2) and (2,1,2,3,2).

Examples

			The a(n) alternating permutations of prime indices for n = 180, 210, 300, 420, 900:
  (12132)  (1324)  (13132)  (12143)  (121323)
  (21213)  (1423)  (13231)  (13142)  (132312)
  (21312)  (2143)  (21313)  (13241)  (213132)
  (23121)  (2314)  (23131)  (14132)  (213231)
  (31212)  (2413)  (31213)  (14231)  (231213)
           (3142)  (31312)  (21314)  (231312)
           (3241)           (21413)  (312132)
           (3412)           (23141)  (323121)
           (4132)           (24131)
           (4231)           (31214)
                            (31412)
                            (34121)
                            (41213)
                            (41312)
		

Crossrefs

Counting all permutations gives A008480.
Dominated by A335452 (number of separations of prime factors).
Including twins (x,x) gives A344606.
Positions of zeros are A345171, counted by A345165.
Positions of nonzero terms are A345172.
A000041 counts integer partitions.
A001250 counts alternating permutations.
A003242 counts anti-run compositions.
A025047 counts alternating or wiggly compositions, also A025048, A025049.
A325534 counts separable partitions, ranked by A335433.
A325535 counts inseparable partitions, ranked by A335448.
A344604 counts alternating compositions with twins.
A344654 counts non-twin partitions w/o alternating permutation, rank: A344653.
A344740 counts twins and partitions w/ alternating permutation, rank: A344742.
A345166 counts separable partitions w/o alternating permutation, rank: A345173.
A345170 counts partitions with a alternating permutation.

Programs

  • Mathematica
    wigQ[y_]:=Or[Length[y]==0,Length[Split[y]]==Length[y]&&Length[Split[Sign[Differences[y]]]]==Length[y]-1];
    Table[Length[Select[Permutations[Flatten[ConstantArray@@@FactorInteger[n]]],wigQ]],{n,30}]

A345171 Numbers whose multiset of prime factors has no alternating permutation.

Original entry on oeis.org

4, 8, 9, 16, 24, 25, 27, 32, 40, 48, 49, 54, 56, 64, 80, 81, 88, 96, 104, 112, 121, 125, 128, 135, 136, 144, 152, 160, 162, 169, 176, 184, 189, 192, 208, 224, 232, 240, 243, 248, 250, 256, 270, 272, 288, 289, 296, 297, 304, 320, 324, 328, 336, 343, 344, 351
Offset: 1

Views

Author

Gus Wiseman, Jun 13 2021

Keywords

Comments

First differs from A335448 in having 270.
A sequence is alternating if it is alternately strictly increasing and strictly decreasing, starting with either. For example, the partition (3,2,2,2,1) has no alternating permutations, even though it has the anti-run permutations (2,3,2,1,2) and (2,1,2,3,2).
Also Heinz numbers of integer partitions without a wiggly permutation, where the Heinz number of a partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k).

Examples

			The sequence of terms together with their prime indices begins:
    4: {1,1}
    8: {1,1,1}
    9: {2,2}
   16: {1,1,1,1}
   24: {1,1,1,2}
   25: {3,3}
   27: {2,2,2}
   32: {1,1,1,1,1}
   40: {1,1,1,3}
   48: {1,1,1,1,2}
   49: {4,4}
   54: {1,2,2,2}
   56: {1,1,1,4}
   64: {1,1,1,1,1,1}
   80: {1,1,1,1,3}
   81: {2,2,2,2}
   88: {1,1,1,5}
   96: {1,1,1,1,1,2}
		

Crossrefs

Removing squares of primes A001248 gives A344653, counted by A344654.
A superset of A335448, which is counted by A325535.
Positions of 0's in A345164.
The partitions with these Heinz numbers are counted by A345165.
The complement is A345172, counted by A345170.
The separable case is A345173, counted by A345166.
A001250 counts alternating permutations, complement A348615.
A003242 counts anti-run compositions, complement A261983.
A025047 counts alternating or wiggly compositions, directed A025048, A025049.
A325534 counts separable partitions, ranked by A335433.
A344606 counts alternating permutations of prime indices with twins.
A344742 ranks twins and partitions with an alternating permutation.
A345192 counts non-alternating compositions.

Programs

  • Mathematica
    wigQ[y_]:=Or[Length[y]==0,Length[Split[y]]== Length[y]&&Length[Split[Sign[Differences[y]]]]==Length[y]-1];
    Select[Range[100],Select[Permutations[Flatten[ ConstantArray@@@FactorInteger[#]]],wigQ]=={}&]

A349057 Numbers k such that the k-th composition in standard order is not weakly alternating.

Original entry on oeis.org

37, 46, 52, 53, 69, 75, 78, 92, 93, 101, 104, 105, 107, 110, 116, 117, 133, 137, 139, 142, 150, 151, 156, 157, 165, 174, 180, 181, 184, 185, 186, 187, 190, 197, 200, 201, 203, 206, 208, 209, 210, 211, 214, 215, 220, 221, 229, 232, 233, 235, 238, 244, 245, 261
Offset: 1

Views

Author

Gus Wiseman, Dec 04 2021

Keywords

Comments

We define a sequence to be weakly alternating if it is alternately weakly increasing and weakly decreasing, starting with either.
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 and corresponding compositions begin:
   37: (3,2,1)
   46: (2,1,1,2)
   52: (1,2,3)
   53: (1,2,2,1)
   69: (4,2,1)
   75: (3,2,1,1)
   78: (3,1,1,2)
   92: (2,1,1,3)
   93: (2,1,1,2,1)
  101: (1,3,2,1)
  104: (1,2,4)
  105: (1,2,3,1)
  107: (1,2,2,1,1)
  110: (1,2,1,1,2)
  116: (1,1,2,3)
  117: (1,1,2,2,1)
		

Crossrefs

The strong case is A345168, complement A345167, counted by A345192.
The strong anti-run case is A345169, counted by A345195.
Including all non-anti-runs gives A348612, complement A333489.
These compositions are counted by A349053, complement A349052.
The directed cases are counted by A129852 (incr.) and A129853 (decr.).
The complement for patterns is A349058, strong A345194.
The complement for ordered factorizations is A349059, strong A348610.
Partitions of this type are counted by A349061, complement A349060.
Partitions of this type are ranked by A349794.
Non-strict partitions of this type are counted by A349796.
Permutations of prime indices of this type are counted by A349797.
A001250 counts alternating permutations, complement A348615.
A003242 counts Carlitz (anti-run) compositions, complement A261983.
A011782 counts compositions.
A025047 counts alternating/wiggly compositions, directed A025048, A025049.
A345164 counts alternating permutations of prime indices, weak A349056.
A345165 counts partitions w/o an alternating permutation, ranked by A345171.
A345170 counts partitions w/ an alternating permutation, ranked by A345172.
A349054 counts strict alternating compositions.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[ Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    whkQ[y_]:=And@@Table[If[EvenQ[m], y[[m]]<=y[[m+1]],y[[m]]>=y[[m+1]]],{m,1,Length[y]-1}];
    Select[Range[0,100],!whkQ[stc[#]]&&!whkQ[-stc[#]]&]

A345166 Number of separable integer partitions of n without an alternating permutation.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 2, 3, 5, 6, 7, 10, 14, 18, 21, 27, 35, 42, 54, 65, 78, 95, 117, 140, 170, 202, 239, 286, 343, 401, 476, 562, 660, 775, 910, 1056, 1241, 1444, 1678, 1948, 2267, 2615, 3031, 3502, 4036, 4647, 5356, 6143, 7068, 8101, 9274, 10613, 12151, 13856
Offset: 0

Views

Author

Gus Wiseman, Jun 13 2021

Keywords

Comments

A partition is separable if it has an anti-run permutation (no adjacent parts equal).
A sequence is alternating if it is alternately strictly increasing and strictly decreasing, starting with either. For example, the partition (3,2,2,2,1) has no alternating permutations, even though it has the anti-run permutations (2,3,2,1,2) and (2,1,2,3,2).
The partitions counted by this sequence are those with 2m-1 parts with m being the multiplicity of a part which is neither the smallest or largest part. For example, 4322221 is such a partition since the multiplicity of 2 is 4, the total number of parts is 7, and 2 is neither the smallest or largest part. - Andrew Howroyd, Jan 15 2024

Examples

			The a(10) = 1 through a(16) = 6 partitions:
    32221  42221  52221  62221    43331    43332    53332
                         3222211  72221    53331    63331
                                  4222211  82221    92221
                                           3322221  4322221
                                           5222211  6222211
                                                    322222111
		

Crossrefs

Allowing alternating permutations gives A325534, ranked by A335433.
Not requiring separability gives A345165, ranked by A345171.
Permutations of this type are ranked by A345169.
The Heinz numbers of these partitions are A345173.
Numbers with a factorization of this type are A348609.
A000041 counts integer partitions.
A001250 counts alternating permutations, complement A348615.
A003242 counts anti-run compositions.
A005649 counts anti-run patterns.
A025047 counts alternating or wiggly compositions, also A025048, A025049.
A325535 counts inseparable partitions, ranked by A335448.
A344654 counts non-twin partitions w/o alt permutation, rank A344653.
A345162 counts normal partitions w/o alt permutation, complement A345163.
A345170 counts partitions w/ alt permutation, ranked by A345172.

Programs

  • Mathematica
    wigQ[y_]:=Or[Length[y]==0,Length[Split[y]]== Length[y]&&Length[Split[Sign[Differences[y]]]]==Length[y]-1];
    Table[Length[Select[IntegerPartitions[n],Select[Permutations[#],!MatchQ[#,{_,x_,x_,_}]&]!={}&&Select[Permutations[#],wigQ]=={}&]],{n,0,15}]

Formula

The Heinz numbers of these partitions are A345173 = A345171 /\ A335433.
a(n) = A325534(n) - A345170(n). - Andrew Howroyd, Jan 15 2024

Extensions

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

A344742 Numbers whose prime factors have a permutation with no consecutive monotone triple, i.e., no triple (..., x, y, z, ...) such that either x <= y <= z or x >= y >= z.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 25, 26, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 55, 57, 58, 59, 60, 61, 62, 63, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77
Offset: 1

Views

Author

Gus Wiseman, Jun 12 2021

Keywords

Comments

Differs from A335433 in having all squares of primes (A001248) and lacking 270 etc.
Also Heinz numbers of integer partitions that are either a twin (x,x) or have a wiggly permutation.
(1) 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.
(2) A sequence is wiggly if it is alternately strictly increasing and strictly decreasing, starting with either. For example, the partition (3,2,2,2,1) has no wiggly permutations, even though it has anti-run permutations (2,3,2,1,2) and (2,1,2,3,2).

Examples

			The sequence of terms together with their prime indices begins:
      1: {}          18: {1,2,2}     36: {1,1,2,2}
      2: {1}         19: {8}         37: {12}
      3: {2}         20: {1,1,3}     38: {1,8}
      4: {1,1}       21: {2,4}       39: {2,6}
      5: {3}         22: {1,5}       41: {13}
      6: {1,2}       23: {9}         42: {1,2,4}
      7: {4}         25: {3,3}       43: {14}
      9: {2,2}       26: {1,6}       44: {1,1,5}
     10: {1,3}       28: {1,1,4}     45: {2,2,3}
     11: {5}         29: {10}        46: {1,9}
     12: {1,1,2}     30: {1,2,3}     47: {15}
     13: {6}         31: {11}        49: {4,4}
     14: {1,4}       33: {2,5}       50: {1,3,3}
     15: {2,3}       34: {1,7}       51: {2,7}
     17: {7}         35: {3,4}       52: {1,1,6}
For example, the prime factors of 120 are (2,2,2,3,5), with the two wiggly permutations (2,3,2,5,2) and (2,5,2,3,2), so 120 is in the sequence.
		

Crossrefs

Positions of nonzero terms in A344606.
The complement is A344653, counted by A344654.
These partitions are counted by A344740.
A000041 counts partitions of 2n with alternating sum 0, ranked by A000290.
A001248 lists squares of primes.
A001250 counts wiggly permutations.
A003242 counts anti-run compositions.
A011782 counts compositions.
A025047 counts wiggly compositions (ascend: A025048, descend: A025049).
A056239 adds up prime indices, row sums of A112798.
A325534 counts separable partitions, ranked by A335433.
A325535 counts inseparable partitions, ranked by A335448.
A344604 counts wiggly compositions with twins.
A345164 counts wiggly permutations of prime indices.
A345165 counts partitions without a wiggly permutation, ranked by A345171.
A345170 counts partitions with a wiggly permutation, ranked by A345172.
A345192 counts non-wiggly compositions.

Programs

  • Mathematica
    Select[Range[100],Select[Permutations[Flatten[ConstantArray@@@FactorInteger[#]]],!MatchQ[#,{_,x_,y_,z_,_}/;x<=y<=z||x>=y>=z]&]!={}&]

Formula

Union of A345172 (wiggly) and A001248 (squares of primes).

A345169 Numbers k such that the k-th composition in standard order is a non-alternating anti-run.

Original entry on oeis.org

37, 52, 69, 101, 104, 105, 133, 137, 150, 165, 180, 197, 200, 208, 209, 210, 261, 265, 274, 278, 300, 301, 308, 325, 328, 357, 360, 361, 389, 393, 400, 401, 406, 416, 417, 418, 421, 422, 436, 517, 521, 529, 530, 534, 549, 550, 556, 557, 564, 581, 600, 601, 613
Offset: 1

Views

Author

Gus Wiseman, Jun 15 2021

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.
A sequence is alternating if it is alternately strictly increasing and strictly decreasing, starting with either. For example, the partition (3,2,2,2,1) has no alternating permutations, even though it does have the anti-run permutations (2,3,2,1,2) and (2,1,2,3,2).
An anti-run (separation or Carlitz composition) is a sequence with no adjacent equal parts.

Examples

			The sequence of terms together with their binary indices begins:
     37: (3,2,1)      210: (1,2,3,2)      400: (1,3,5)
     52: (1,2,3)      261: (6,2,1)        401: (1,3,4,1)
     69: (4,2,1)      265: (5,3,1)        406: (1,3,2,1,2)
    101: (1,3,2,1)    274: (4,3,2)        416: (1,2,6)
    104: (1,2,4)      278: (4,2,1,2)      417: (1,2,5,1)
    105: (1,2,3,1)    300: (3,2,1,3)      418: (1,2,4,2)
    133: (5,2,1)      301: (3,2,1,2,1)    421: (1,2,3,2,1)
    137: (4,3,1)      308: (3,1,2,3)      422: (1,2,3,1,2)
    150: (3,2,1,2)    325: (2,4,2,1)      436: (1,2,1,2,3)
    165: (2,3,2,1)    328: (2,3,4)        517: (7,2,1)
    180: (2,1,2,3)    357: (2,1,3,2,1)    521: (6,3,1)
    197: (1,4,2,1)    360: (2,1,2,4)      529: (5,4,1)
    200: (1,3,4)      361: (2,1,2,3,1)    530: (5,3,2)
    208: (1,2,5)      389: (1,5,2,1)      534: (5,2,1,2)
    209: (1,2,4,1)    393: (1,4,3,1)      549: (4,3,2,1)
		

Crossrefs

A version counting partitions is A345166, ranked by A345173.
These compositions are counted by A345195.
A001250 counts alternating permutations, complement A348615.
A003242 counts anti-run compositions.
A005649 counts anti-run patterns.
A025047 counts alternating or wiggly compositions, also A025048, A025049.
A325534 counts separable partitions, ranked by A335433.
A325535 counts inseparable partitions, ranked by A335448.
A345164 counts alternating permutations of prime indices.
A345165 counts partitions w/o an alternating permutation, ranked by A345171.
A345170 counts partitions w/ an alternating permutation, ranked by A345172.
A345192 counts non-alternating compositions.
A345194 counts alternating patterns (with twins: A344605).
Statistics of standard compositions:
- Length is A000120.
- Constant runs are A124767.
- Heinz number is A333219.
- Anti-runs are A333381.
- Runs-resistance is A333628.
- Number of distinct parts is A334028.
- Non-anti-runs are A348612.
Classes of standard compositions:
- Weakly decreasing compositions (partitions) are A114994.
- Weakly increasing compositions (multisets) are A225620.
- Strict compositions are A233564.
- Constant compositions are A272919.
- Strictly increasing compositions (sets) are A333255.
- Strictly decreasing compositions (strict partitions) are A333256.
- Anti-runs are A333489.
- Alternating compositions are A345167.
- Non-Alternating compositions are A345168.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[ Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    wigQ[y_]:=Or[Length[y]==0,Length[Split[y]]== Length[y]&&Length[Split[Sign[Differences[y]]]]==Length[y]-1];
    sepQ[y_]:=!MatchQ[y,{_,x_,x_,_}];
    Select[Range[0,1000],sepQ[stc[#]]&&!wigQ[stc[#]]&]

Formula

Intersection of A345168 (non-alternating) and A333489 (anti-run).

A349056 Number of weakly alternating permutations of the multiset of prime factors of n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Dec 02 2021

Keywords

Comments

We define a sequence to be weakly alternating if it is alternately weakly increasing and weakly decreasing, starting with either. Then a sequence is alternating in the sense of A025047 iff it is a weakly alternating anti-run.
A prime index of n is a number m such that prime(m) divides n. For n > 1, the multiset of prime factors of n is row n of A027746. The prime indices A112798 can also be used.

Examples

			The following are the weakly alternating permutations for selected n:
n = 2   6    12    24     48      60     90     120     180
   ----------------------------------------------------------
    2   23   223   2223   22223   2253   2335   22253   22335
        32   232   2232   22232   2325   2533   22325   22533
             322   2322   22322   2523   3253   22523   23253
                   3222   23222   3252   3325   23252   23352
                          32222   3522   3352   25232   25233
                                  5232   3523   32225   25332
                                         5233   32522   32325
                                         5332   35222   32523
                                                52223   33252
                                                52322   33522
                                                        35232
                                                        52323
                                                        53322
		

Crossrefs

Counting all permutations of prime factors gives A008480.
The variation counting anti-run permutations is A335452.
The strong case is A345164, with twins A344606.
Compositions of this type are counted by A349052, also A129852 and A129853.
Compositions not of this type are counted by A349053, ranked by A349057.
The version for patterns is A349058, strong A345194.
The version for ordered factorizations is A349059, strong A348610.
Partitions of this type are counted by A349060, complement A349061.
The complement is counted by A349797.
The non-alternating case is A349798.
A001250 counts alternating permutations, complement A348615.
A003242 counts Carlitz (anti-run) compositions.
A025047 counts alternating or wiggly compositions, ranked by A345167.
A056239 adds up prime indices, row sums of A112798, row lengths A001222.
A071321 gives the alternating sum of prime factors, reverse A071322.
A344616 gives the alternating sum of prime indices, reverse A316524.
A345165 counts partitions w/o an alternating permutation, ranked by A345171.
A345170 counts partitions w/ an alternating permutation, ranked by A345172.
A348379 counts factorizations with an alternating permutation.
A349800 counts weakly but not strongly alternating compositions.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    whkQ[y_]:=And@@Table[If[EvenQ[m],y[[m]]<=y[[m+1]],y[[m]]>=y[[m+1]]],{m,1,Length[y]-1}];
    Table[Length[Select[Permutations[primeMS[n]],whkQ[#]||whkQ[-#]&]],{n,100}]
Showing 1-10 of 23 results. Next