cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Previous Showing 11-20 of 24 results. Next

A345195 Number of non-alternating anti-run compositions of n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 2, 4, 10, 23, 49, 96, 192, 368, 692, 1299, 2403, 4400, 8029, 14556, 26253, 47206, 84574, 151066, 269244, 478826, 849921, 1506309, 2665829, 4711971, 8319763, 14675786, 25865400, 45552678, 80171353, 141015313, 247905305, 435614270, 765132824
Offset: 0

Views

Author

Gus Wiseman, Jun 17 2021

Keywords

Comments

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 a(9) = 23 anti-runs:
  (1,2,6)  (1,2,4,2)  (1,2,1,2,3)
  (1,3,5)  (1,2,5,1)  (1,2,3,1,2)
  (2,3,4)  (1,3,4,1)  (1,2,3,2,1)
  (4,3,2)  (1,4,3,1)  (1,3,2,1,2)
  (5,3,1)  (1,5,2,1)  (2,1,2,3,1)
  (6,2,1)  (2,1,2,4)  (2,1,3,2,1)
           (2,4,2,1)  (3,2,1,2,1)
           (3,1,2,3)
           (3,2,1,3)
           (4,2,1,2)
		

Crossrefs

Non-anti-run compositions are counted by A261983.
A version counting partitions is A345166, ranked by A345173.
These compositions are ranked by A345169.
Non-alternating compositions are counted by A345192, ranked by A345168.
A001250 counts alternating permutations, complement A348615.
A003242 counts anti-run compositions, ranked by A333489.
A011782 counts compositions.
A025047 counts alternating or wiggly compositions, ranked by A345167.
A032020 counts strict compositions.
A106356 counts compositions by number of maximal anti-runs.
A325534 counts separable partitions, ranked by A335433.
A325535 counts inseparable partitions, ranked by A335448.
A345164 counts alternating permutations of prime indices, w/ twins A344606.
A345165 counts partitions w/o an alternating permutation, ranked by A345171.
A345170 counts partitions w/ an alternating permutation, ranked by A345172.
A345194 counts alternating patterns (with twins: A344605).

Programs

  • Mathematica
    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_,_}];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n], sepQ[#]&&!wigQ[#]&]],{n,0,15}]

Formula

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

Extensions

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

A349055 Number of multisets of size n that have an alternating permutation and cover an initial interval of positive integers.

Original entry on oeis.org

1, 1, 1, 3, 5, 12, 24, 52, 108, 224, 464, 944, 1936, 3904, 7936, 15936, 32192, 64512, 129792, 259840, 521472, 1043456, 2091008, 4183040, 8375296, 16752640, 33525760, 67055616, 134156288, 268320768, 536739840, 1073496064, 2147205120, 4294443008, 8589344768
Offset: 0

Views

Author

Gus Wiseman, Dec 12 2021

Keywords

Comments

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). Alternating permutations of multisets are a generalization of alternating or up-down permutations of {1..n}.
The multisets that have an alternating permutation are those which have no part with multiplicity greater than floor(n/2) except for odd n when either the smallest or largest part can have multiplicity ceiling(n/2). - Andrew Howroyd, Jan 13 2024

Examples

			The multiset {1,2,2,3} has alternating permutations (2,1,3,2), (2,3,1,2), so is counted under a(4).
The a(1) = 1 through a(5) = 12 multisets:
  {1}  {1,2}  {1,1,2}  {1,1,2,2}  {1,1,1,2,2}
              {1,2,2}  {1,1,2,3}  {1,1,1,2,3}
              {1,2,3}  {1,2,2,3}  {1,1,2,2,2}
                       {1,2,3,3}  {1,1,2,2,3}
                       {1,2,3,4}  {1,1,2,3,3}
                                  {1,1,2,3,4}
                                  {1,2,2,3,3}
                                  {1,2,2,3,4}
                                  {1,2,3,3,3}
                                  {1,2,3,3,4}
                                  {1,2,3,4,4}
                                  {1,2,3,4,5}
As compositions:
  (1)  (1,1)  (1,2)    (2,2)      (2,3)
              (2,1)    (1,1,2)    (3,2)
              (1,1,1)  (1,2,1)    (1,1,3)
                       (2,1,1)    (1,2,2)
                       (1,1,1,1)  (2,1,2)
                                  (2,2,1)
                                  (3,1,1)
                                  (1,1,1,2)
                                  (1,1,2,1)
                                  (1,2,1,1)
                                  (2,1,1,1)
                                  (1,1,1,1,1)
		

Crossrefs

The strong inseparable case is A025065.
A separable instead of alternating version is A336103, complement A336102.
The case of weakly decreasing multiplicities is A336106.
The version for non-twin partitions is A344654, ranked by A344653.
The complement for non-twin partitions is A344740, ranked by A344742.
The complement for partitions is A345165, ranked by A345171.
The version for partitions is A345170, ranked by A345172.
The version for factorizations is A348379, complement A348380.
The complement (still covering an initial interval) is counted by A349050.
A000670 counts sequences covering an initial interval, anti-run A005649.
A001250 counts alternating permutations, complement A348615.
A003242 counts Carlitz (anti-run) compositions, ranked by A333489.
A025047 = alternating compositions, ranked by A345167, also A025048/A025049.
A049774 counts permutations avoiding the consecutive pattern (1,2,3).
A325534 counts separable partitions, ranked by A335433.
A325535 counts inseparable partitions, ranked by A335448.

Programs

  • Mathematica
    allnorm[n_]:=If[n<=0,{{}},Function[s, Array[Count[s,y_/;y<=#]+1&,n]]/@Subsets[Range[n-1]+1]];
    wigQ[y_]:=Or[Length[y]==0, Length[Split[y]]==Length[y]&&Length[Split[Sign[Differences[y]]]]==Length[y]-1];
    Table[Length[Select[allnorm[n], Select[Permutations[#],wigQ]!={}&]],{n,0,7}]
  • PARI
    a(n) = if(n==0, 1, 2^(n-1) - if(n%2==0, (n+2)*2^(n/2-3), (n-1)*2^((n-5)/2))) \\ Andrew Howroyd, Jan 13 2024

Formula

a(n) = A011782(n) - A349050(n).
a(n) = 2^(n-1) - (n+2)*2^(n/2-3) for even n > 0; a(n) = 2^(n-1) - (n-1)*2^((n-5)/2) for odd n. - Andrew Howroyd, Jan 13 2024

Extensions

Terms a(10) and beyond from Andrew Howroyd, Jan 13 2024

A349059 Number of weakly alternating ordered factorizations of n.

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 1, 4, 2, 3, 1, 8, 1, 3, 3, 8, 1, 8, 1, 8, 3, 3, 1, 18, 2, 3, 4, 8, 1, 11, 1, 16, 3, 3, 3, 22, 1, 3, 3, 18, 1, 11, 1, 8, 8, 3, 1, 38, 2, 8, 3, 8, 1, 18, 3, 18, 3, 3, 1, 32, 1, 3, 8, 28, 3, 11, 1, 8, 3, 11, 1, 56, 1, 3, 8, 8, 3, 11, 1, 38, 8, 3
Offset: 1

Views

Author

Gus Wiseman, Dec 04 2021

Keywords

Comments

An ordered factorization of n is a finite sequence of positive integers > 1 with product n.
We define a sequence to be weakly alternating if it is alternately weakly increasing and weakly decreasing, starting with either.

Examples

			The ordered factorizations for n = 2, 4, 6, 8, 12, 24, 30:
  (2)  (4)    (6)    (8)      (12)     (24)       (30)
       (2*2)  (2*3)  (2*4)    (2*6)    (3*8)      (5*6)
              (3*2)  (4*2)    (3*4)    (4*6)      (6*5)
                     (2*2*2)  (4*3)    (6*4)      (10*3)
                              (6*2)    (8*3)      (15*2)
                              (2*2*3)  (12*2)     (2*15)
                              (2*3*2)  (2*12)     (3*10)
                              (3*2*2)  (2*2*6)    (2*5*3)
                                       (2*4*3)    (3*2*5)
                                       (2*6*2)    (3*5*2)
                                       (3*2*4)    (5*2*3)
                                       (3*4*2)
                                       (4*2*3)
                                       (6*2*2)
                                       (2*2*2*3)
                                       (2*2*3*2)
                                       (2*3*2*2)
                                       (3*2*2*2)
		

Crossrefs

The strong version for compositions is A025047, also A025048, A025049.
The strong case is A348610, complement A348613.
The version for compositions is A349052, complement A349053.
As compositions these are ranked by the complement of A349057.
A001055 counts factorizations, strict A045778, ordered A074206.
A001250 counts alternating permutations, complement A348615.
A335434 counts separable factorizations, complement A333487.
A345164 counts alternating permutations of prime factors, w/ twins A344606.
A345170 counts partitions with an alternating permutation.
A348379 = factorizations w/ alternating permutation, complement A348380.
A348611 counts anti-run ordered factorizations, complement A348616.
A349060 counts weakly alternating partitions, complement A349061.
A349800 = weakly but not strongly alternating compositions, ranked A349799.

Programs

  • Mathematica
    facs[n_]:=If[n<=1,{{}},Join@@Table[Map[Prepend[#,d]&, Select[facs[n/d],Min@@#>=d&]],{d,Rest[Divisors[n]]}]];
    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[Join@@Permutations/@facs[n], whkQ[#]||whkQ[-#]&]],{n,100}]

Formula

a(2^n) = A349052(n).

A349058 Number of weakly alternating patterns of length n.

Original entry on oeis.org

1, 1, 3, 11, 43, 203, 1123, 7235, 53171, 439595, 4037371, 40787579, 449500595, 5366500163, 68997666867, 950475759899, 13966170378907, 218043973366091, 3604426485899203, 62894287709616755, 1155219405655975763, 22279674547003283003, 450151092568978825707
Offset: 0

Views

Author

Gus Wiseman, Dec 04 2021

Keywords

Comments

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.
We define a sequence to be weakly alternating if it is alternately weakly increasing and weakly decreasing, starting with either.

Examples

			The a(1) = 1 through a(3) = 11 patterns:
  (1)  (1,1)  (1,1,1)
       (1,2)  (1,1,2)
       (2,1)  (1,2,1)
              (1,2,2)
              (1,3,2)
              (2,1,1)
              (2,1,2)
              (2,1,3)
              (2,2,1)
              (2,3,1)
              (3,1,2)
		

Crossrefs

The strict case is A001250, complement A348615.
The strong case of compositions is A025047, ranked by A345167.
The unordered version is A052955.
The strong case is A345194, with twins A344605. Also the directed case.
The version for compositions is A349052, complement A349053.
The version for permutations of prime indices: A349056, complement A349797.
The version for compositions is ranked by A349057.
The version for ordered factorizations is A349059, strong A348610.
The version for partitions is A349060, complement A349061.
A003242 counts Carlitz (anti-run) compositions.
A005649 counts anti-run patterns.
A344604 counts alternating compositions with twins.
A345163 counts normal partitions with an alternating permutation.
A345170 counts partitions w/ an alternating permutation, complement A345165.
A345192 counts non-alternating compositions, ranked by A345168.
A349055 counts multisets w/ an alternating permutation, complement A349050.

Programs

  • Mathematica
    allnorm[n_]:=If[n<=0,{{}},Function[s,Array[Count[s, y_/;y<=#]+1&,n]]/@Subsets[Range[n-1]+1]];
    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[Join@@Permutations/@allnorm[n],whkQ[#]||whkQ[-#]&]],{n,0,6}]
  • PARI
    R(n,k)={my(v=vector(k,i,1), u=vector(n)); for(r=1, n, if(r%2==0, my(s=v[k]); forstep(i=k, 2, -1, v[i] = s - v[i-1]); v[1] = s); for(i=2, k, v[i] += v[i-1]); u[r]=v[k]); u}
    seq(n)= {concat([1], -vector(n,i,1) + 2*sum(k=1, n, R(n, k)*sum(r=k, n, binomial(r, k)*(-1)^(r-k)) ) )} \\ Andrew Howroyd, Jan 13 2024

Extensions

a(9)-a(18) from Alois P. Heinz, Dec 10 2021
a(19) onwards from Andrew Howroyd, Jan 13 2024

A349800 Number of integer compositions of n that are weakly alternating and have at least two adjacent equal parts.

Original entry on oeis.org

0, 0, 1, 1, 4, 9, 16, 33, 62, 113, 205, 373, 664, 1190, 2113, 3744, 6618, 11683, 20564, 36164, 63489, 111343, 195042, 341357, 596892, 1042976, 1821179, 3178145, 5543173, 9663545, 16839321, 29332231, 51075576, 88908912, 154722756, 269186074, 468221264
Offset: 0

Views

Author

Gus Wiseman, Dec 16 2021

Keywords

Comments

We define a sequence to be weakly alternating if it is alternately weakly increasing and weakly decreasing, starting with either.
This sequence counts compositions that are weakly but not strongly alternating; also weakly alternating non-anti-run compositions.

Examples

			The a(2) = 1 through a(6) = 16 compositions:
  (1,1)  (1,1,1)  (2,2)      (1,1,3)      (3,3)
                  (1,1,2)    (1,2,2)      (1,1,4)
                  (2,1,1)    (2,2,1)      (2,2,2)
                  (1,1,1,1)  (3,1,1)      (4,1,1)
                             (1,1,1,2)    (1,1,1,3)
                             (1,1,2,1)    (1,1,2,2)
                             (1,2,1,1)    (1,1,3,1)
                             (2,1,1,1)    (1,3,1,1)
                             (1,1,1,1,1)  (2,2,1,1)
                                          (3,1,1,1)
                                          (1,1,1,1,2)
                                          (1,1,1,2,1)
                                          (1,1,2,1,1)
                                          (1,2,1,1,1)
                                          (2,1,1,1,1)
                                          (1,1,1,1,1,1)
		

Crossrefs

This is the weakly alternating case of A345192, ranked by A345168.
The case of partitions is A349795, ranked by A350137.
The version counting permutations of prime indices is A349798.
These compositions are ranked by A349799.
A001250 = alternating permutations, ranked by A349051, complement A348615.
A003242 = Carlitz (anti-run) compositions, ranked by A333489.
A025047/A025048/A025049 = alternating compositions, ranked by A345167.
A261983 = non-anti-run compositions, ranked by A348612.
A345165 = partitions without an alternating permutation, ranked by A345171.
A345170 = partitions with an alternating permutation, ranked by A345172.
A345173 = non-alternating anti-run partitions, ranked by A345166.
A345195 = non-alternating anti-run compositions, ranked by A345169.
A348377 = non-alternating non-twin compositions.
A349801 = non-alternating partitions, ranked by A289553.
Weakly alternating:
- A349052 = compositions, directed A129852/A129853, complement A349053.
- A349056 = permutations of prime indices, complement A349797.
- A349057 = complement of standard composition numbers (too dense).
- A349058 = patterns, complement A350138.
- A349059 = ordered factorizations, complement A350139.
- A349060 = partitions, complement A349061.

Programs

  • Mathematica
    wigQ[y_]:=Or[Length[y]==0,Length[Split[y]]==Length[y] &&Length[Split[Sign[Differences[y]]]]==Length[y]-1];
    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[Join@@Permutations/@IntegerPartitions[n],(whkQ[#]||whkQ[-#])&&!wigQ[#]&]],{n,0,10}]

Formula

a(n) = A349052(n) - A025047(n). - Andrew Howroyd, Jan 31 2024

Extensions

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

A349797 Number of non-weakly alternating permutations of the multiset of prime factors of n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Dec 24 2021

Keywords

Comments

First differs from 2 * A326291 at a(90) = 4, A326291(90) = 3.
The first odd term is a(144) = 7, whose non-weakly alternating permutations are shown in the example below.
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.
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 = 30    60     72      120     144      180
   ---------------------------------------------
    235   2235   22332   22235   222332   22353
    532   2352   23223   22352   223223   23235
          2532   23322   22532   223322   23325
          3225   32232   23225   232232   23523
          5223           23522   233222   23532
          5322           25223   322223   25323
                         25322   322322   32235
                         32252            32253
                         52232            32352
                         53222            32532
                                          33225
                                          35223
                                          35322
                                          52233
                                          52332
                                          53223
                                          53232
		

Crossrefs

Counting all permutations of prime factors gives A008480.
Compositions not of this type are counted by A349052/A129852/A129853.
Compositions of this type are counted by A349053, ranked by A349057.
The complement is counted by A349056.
Partitions of this type are counted by A349061, complement A349060.
The version counting patterns is A350138, complement A349058.
The version counting ordered factorizations is A350139, complement A349059.
The strong case is counted by A350251, complement A345164.
Positions of nonzero terms are A350353.
A001250 counts alternating permutations, complement A348615.
A025047 = alternating compositions, ranked by A345167, complement A345192.
A056239 adds up prime indices, row sums of A112798, row lengths A001222.
A071321 gives the alternating sum of prime factors, reverse A071322.
A335452 counts anti-run permutations of prime factors, complement A336107.
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.

Programs

  • Mathematica
    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[Flatten[ConstantArray@@@ FactorInteger[n]]], !whkQ[#]&&!whkQ[-#]&]],{n,100}]

Formula

a(n) = A008480(n) - A349056(n).

A350252 Number of non-alternating patterns of length n.

Original entry on oeis.org

0, 0, 1, 7, 53, 439, 4121, 43675, 519249, 6867463, 100228877, 1602238783, 27866817297, 524175098299, 10606844137009, 229807953097903, 5308671596791901, 130261745042452855, 3383732450013895721, 92770140175473602755, 2677110186541556215233
Offset: 0

Views

Author

Gus Wiseman, Jan 13 2022

Keywords

Comments

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 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 alternating pattern is necessarily an anti-run (A005649).
Conjecture: Also the number of non-weakly up/down (or down/up) patterns of length n. For example:
- The a(3) = 7 non-weakly up/down patterns:
(121), (122), (123), (132), (221), (231), (321)
- The a(3) = 7 non-weakly down/up patterns:
(112), (123), (211), (212), (213), (312), (321)
- The a(3) = 7 non-alternating patterns (see example for more):
(111), (112), (122), (123), (211), (221), (321)

Examples

			The a(2) = 1 and a(3) = 7 non-alternating patterns:
  (1,1)  (1,1,1)
         (1,1,2)
         (1,2,2)
         (1,2,3)
         (2,1,1)
         (2,2,1)
         (3,2,1)
The a(4) = 53 non-alternating patterns:
  2112   3124   4123   1112   2134   1234   3112   2113   1123
  2211   3214   4213   1211   2314   1243   3123   2123   1213
  2212   3412   4312   1212   2341   1324   3211   2213   1223
         3421   4321   1221   2413   1342   3212   2311   1231
                       1222   2431   1423   3213   2312   1232
                                     1432   3312   2313   1233
                                            3321   2321   1312
                                                   2331   1321
                                                          1322
                                                          1323
                                                          1332
		

Crossrefs

The unordered version is A122746.
The version for compositions is A345192, ranked by A345168, weak A349053.
The complement is counted by A345194, weak A349058.
The version for factorizations is A348613, complement A348610, weak A350139.
The strict case (permutations) is A348615, complement A001250.
The weak version for partitions is A349061, complement A349060.
The weak version for perms of prime indices is A349797, complement A349056.
The weak version is A350138.
The version for perms of prime indices is A350251, complement A345164.
A000670 = patterns (ranked by A333217).
A003242 = anti-run compositions, complement A261983, ranked by A333489.
A005649 = anti-run patterns, complement A069321.
A019536 = necklace patterns.
A025047/A129852/A129853 = alternating compositions, ranked by A345167.
A226316 = patterns avoiding (1,2,3), weakly A052709, complement A335515.
A345163 = normal partitions w/ alternating permutation, complement A345162.
A345170 = partitions w/ alternating permutation, complement A345165.
A349055 = normal multisets w/ alternating permutation, complement A349050.

Programs

  • Mathematica
    allnorm[n_]:=If[n<=0,{{}},Function[s,Array[Count[s,y_/;y<=#]+1&,n]]/@Subsets[Range[n-1]+1]];
    wigQ[y_]:=Or[Length[y]==0,Length[Split[y]]==Length[y]&& Length[Split[Sign[Differences[y]]]]==Length[y]-1];
    Table[Length[Select[Join@@Permutations/@allnorm[n],!wigQ[#]&]],{n,0,6}]

Formula

a(n) = A000670(n) - A345194(n).

Extensions

Terms a(9) and beyond from Andrew Howroyd, Feb 04 2022

A348609 Numbers with a separable factorization without an alternating permutation.

Original entry on oeis.org

216, 270, 324, 378, 432, 486, 540, 594, 640, 648, 702, 756, 768, 810, 864, 896, 918, 960, 972, 1024, 1026, 1080, 1134, 1152, 1188, 1242, 1280, 1296, 1344, 1350, 1404, 1408, 1458, 1500, 1512, 1536, 1566, 1620, 1664, 1674, 1728, 1750, 1782, 1792, 1836, 1890
Offset: 1

Views

Author

Gus Wiseman, Oct 30 2021

Keywords

Comments

A factorization of n is a weakly increasing sequence of positive integers > 1 with product n.
A multiset is separable if it has a permutation that is an anti-run, meaning there are no adjacent equal parts. Alternatively, a multiset is separable if its greatest multiplicity is greater than the sum of the remaining multiplicities plus one.
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). Alternating permutations of multisets are a generalization of alternating or up-down permutations of sets.
Note that 216 has separable prime factorization (2*2*2*3*3*3) with an alternating permutation, but the separable factorization (2*3*3*3*4) is has no alternating permutation. See also A345173.

Examples

			The terms and their prime factorizations begin:
  216 = 2*2*2*3*3*3
  270 = 2*3*3*3*5
  324 = 2*2*3*3*3*3
  378 = 2*3*3*3*7
  432 = 2*2*2*2*3*3*3
  486 = 2*3*3*3*3*3
  540 = 2*2*3*3*3*5
  594 = 2*3*3*3*11
  640 = 2*2*2*2*2*2*2*5
  648 = 2*2*2*3*3*3*3
  702 = 2*3*3*3*13
  756 = 2*2*3*3*3*7
  768 = 2*2*2*2*2*2*2*2*3
  810 = 2*3*3*3*3*5
  864 = 2*2*2*2*2*3*3*3
		

Crossrefs

Partitions of this type are counted by A345166, ranked by A345173 (a superset).
Compositions of this type are counted by A345195, ranked by A345169.
A001055 counts factorizations, strict A045778, ordered A074206.
A001250 counts alternating permutations, complement A348615.
A025047 counts alternating compositions, complement A345192, ranked by A345167.
A335434 counts separable factorizations, with twins A348383, complement A333487.
A339846 counts even-length factorizations.
A339890 counts odd-length factorizations.
A345165 counts partitions w/o an alternating permutation, complement A345170.
A347438 counts factorizations with alternating product 1, additive A119620.
A348379 counts factorizations w/ an alternating permutation, complement A348380.
A348610 counts alternating ordered factorizations, complement A348613.

Programs

  • Mathematica
    facs[n_]:=If[n<=1,{{}},Join@@Table[Map[Prepend[#,d]&,Select[facs[n/d],Min@@#>=d&]],{d,Rest[Divisors[n]]}]];
    sepQ[m_]:=Select[Permutations[m],!MatchQ[#,{_,x_,x_,_}]&]!={};
    wigQ[y_]:=Or[Length[y]==0,Length[Split[y]]==Length[y]&&Length[Split[Sign[Differences[y]]]]==Length[y]-1];
    Select[Range[1000],Function[n,Select[facs[n],sepQ[#]&&Select[Permutations[#],wigQ]=={}&]!={}]]

A348611 Number of ordered factorizations of n with no adjacent equal factors.

Original entry on oeis.org

1, 1, 1, 1, 1, 3, 1, 3, 1, 3, 1, 6, 1, 3, 3, 4, 1, 6, 1, 6, 3, 3, 1, 14, 1, 3, 3, 6, 1, 13, 1, 7, 3, 3, 3, 17, 1, 3, 3, 14, 1, 13, 1, 6, 6, 3, 1, 29, 1, 6, 3, 6, 1, 14, 3, 14, 3, 3, 1, 36, 1, 3, 6, 14, 3, 13, 1, 6, 3, 13, 1, 45, 1, 3, 6, 6, 3, 13, 1, 29, 4, 3
Offset: 1

Views

Author

Gus Wiseman, Nov 07 2021

Keywords

Comments

First differs from A348610 at a(24) = 14, A348610(24) = 12.
An ordered factorization of n is a finite sequence of positive integers > 1 with product n.
In analogy with Carlitz compositions, these may be called Carlitz ordered factorizations.

Examples

			The a(n) ordered factorizations without adjacent equal factors for n = 1, 6, 12, 16, 24, 30, 32, 36 are:
  ()   6     12      16      24      30      32      36
       2*3   2*6     2*8     3*8     5*6     4*8     4*9
       3*2   3*4     8*2     4*6     6*5     8*4     9*4
             4*3     2*4*2   6*4     10*3    16*2    12*3
             6*2             8*3     15*2    2*16    18*2
             2*3*2           12*2    2*15    2*8*2   2*18
                             2*12    3*10    4*2*4   3*12
                             2*3*4   2*3*5           2*3*6
                             2*4*3   2*5*3           2*6*3
                             2*6*2   3*2*5           2*9*2
                             3*2*4   3*5*2           3*2*6
                             3*4*2   5*2*3           3*4*3
                             4*2*3   5*3*2           3*6*2
                             4*3*2                   6*2*3
                                                     6*3*2
                                                     2*3*2*3
                                                     3*2*3*2
Thus, of total A074206(12) = 8 ordered factorizations of 12, only factorizations 2*2*3 and 3*2*2 (see A348616) are not included in this count, therefore a(12) = 6. - _Antti Karttunen_, Nov 12 2021
		

Crossrefs

The additive version (compositions) is A003242, complement A261983.
The additive alternating version is A025047, ranked by A345167.
Factorizations without a permutation of this type are counted by A333487.
As compositions these are ranked by A333489, complement A348612.
Factorizations with a permutation of this type are counted by A335434.
The non-alternating additive version is A345195, ranked by A345169.
The alternating case is A348610, which is dominated at positions A122181.
The complement is counted by A348616.
A001055 counts factorizations, strict A045778, ordered A074206.
A325534 counts separable partitions, ranked by A335433.
A335452 counts anti-run permutations of prime indices, complement A336107.
A339846 counts even-length factorizations.
A339890 counts odd-length factorizations.
A348613 counts non-alternating ordered factorizations.

Programs

  • Mathematica
    ordfacs[n_]:=If[n<=1,{{}},Join@@Table[Prepend[#,d]&/@ordfacs[n/d],{d,Rest[Divisors[n]]}]];
    antirunQ[y_]:=Length[y]==Length[Split[y]]
    Table[Length[Select[ordfacs[n],antirunQ]],{n,100}]
  • PARI
    A348611(n, e=0) = if(1==n, 1, my(s=0); fordiv(n, d, if((d>1)&&(d!=e), s += A348611(n/d, d))); (s)); \\ Antti Karttunen, Nov 12 2021

Formula

a(n) = A074206(n) - A348616(n).

A350251 Number of non-alternating permutations of the multiset of prime factors of n.

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 2, 0, 0, 0, 1, 0, 2, 0, 2, 0, 0, 0, 4, 1, 0, 1, 2, 0, 2, 0, 1, 0, 0, 0, 4, 0, 0, 0, 4, 0, 2, 0, 2, 2, 0, 0, 5, 1, 2, 0, 2, 0, 4, 0, 4, 0, 0, 0, 8, 0, 0, 2, 1, 0, 2, 0, 2, 0, 2, 0, 9, 0, 0, 2, 2, 0, 2, 0, 5, 1, 0, 0, 8, 0, 0, 0
Offset: 1

Views

Author

Gus Wiseman, Jan 08 2022

Keywords

Comments

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(n) permutations for selected n:
n = 4    12    24     48      60     72      90     96       120
   ----------------------------------------------------------------
    22   223   2223   22223   2235   22233   2335   222223   22235
         322   2232   22232   2253   22323   2353   222232   22253
               2322   22322   2352   22332   2533   222322   22325
               3222   23222   2532   23223   3235   223222   22352
                      32222   3225   23322   3325   232222   22523
                              3522   32223   3352   322222   22532
                              5223   32232   3532            23225
                              5322   32322   5233            23522
                                     33222   5323            25223
                                             5332            25322
                                                             32225
                                                             32252
                                                             32522
                                                             35222
                                                             52223
                                                             52232
                                                             52322
                                                             53222
		

Crossrefs

The non-anti-run case is A336107, complement A335452.
The complement is counted by A345164, with twins A344606.
Positions of nonzero terms are A345171, counted by A345165.
Positions of zeros are A345172, counted by A345170.
Compositions of this type are counted by A345192, ranked by A345168.
Ordered factorizations of this type counted by A348613, complement A348610.
Compositions weakly of this type are counted by A349053, ranked by A349057.
The weak version is A349797, complement A349056.
The case that is also weakly alternating is A349798, compositions A349800.
Patterns of this type are counted by A350252, complement A345194.
A001250 counts alternating permutations, complement A348615.
A003242 counts Carlitz (anti-run) compositions.
A008480 counts permutations of prime factors (ordered prime factorizations).
A025047/A025048/A025049 count alternating compositions, ranked by A345167.
A056239 adds up prime indices, row sums of A112798 (row lengths A001222).
A325534 counts separable partitions, ranked by A335433.
A325535 counts inseparable partitions, ranked by A335448.
A344616 gives the alternating sum of prime indices, reverse A316524.
A349052/A129852/A129853 count weakly alternating compositions.

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

Formula

a(n) = A008480(n) - A345164(n).
Previous Showing 11-20 of 24 results. Next