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

A345165 Number of integer partitions of n without an alternating permutation.

Original entry on oeis.org

0, 0, 1, 1, 2, 2, 5, 5, 8, 11, 17, 20, 29, 37, 51, 65, 85, 106, 141, 175, 223, 277, 351, 432, 540, 663, 820, 999, 1226, 1489, 1817, 2192, 2654, 3191, 3847, 4603, 5517, 6578, 7853, 9327, 11084, 13120, 15533, 18328, 21621, 25430, 29905, 35071, 41111, 48080, 56206, 65554, 76420, 88918
Offset: 0

Views

Author

Gus Wiseman, Jun 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 has the anti-run permutations (2,3,2,1,2) and (2,1,2,3,2).

Examples

			The a(2) = 1 through a(9) = 11 partitions:
  (11)  (111)  (22)    (2111)   (33)      (2221)     (44)        (333)
               (1111)  (11111)  (222)     (4111)     (2222)      (3222)
                                (3111)    (31111)    (5111)      (6111)
                                (21111)   (211111)   (41111)     (22221)
                                (111111)  (1111111)  (221111)    (51111)
                                                     (311111)    (321111)
                                                     (2111111)   (411111)
                                                     (11111111)  (2211111)
                                                                 (3111111)
                                                                 (21111111)
                                                                 (111111111)
		

Crossrefs

Excluding twins (x,x) gives A344654, complement A344740.
The normal case is A345162, complement A345163.
The complement is counted by A345170, ranked by A345172.
The Heinz numbers of these partitions are A345171.
The version for factorizations is A348380, complement A348379.
A version for ordered factorizations is A348613, complement A348610.
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.
A325534 counts separable partitions, ranked by A335433.
A325535 counts inseparable partitions, ranked by A335448.
A344604 counts alternating compositions with twins.
A345164 counts alternating permutations of prime indices, w/ twins A344606.
A345192 counts non-alternating compositions, without twins A348377.

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[#],wigQ]=={}&]],{n,0,15}]

Extensions

a(26) onwards by Joseph Likar, Aug 21 2023

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

Original entry on oeis.org

3, 7, 10, 11, 14, 15, 19, 21, 23, 26, 27, 28, 29, 30, 31, 35, 36, 37, 39, 42, 43, 46, 47, 51, 52, 53, 55, 56, 57, 58, 59, 60, 61, 62, 63, 67, 69, 71, 73, 74, 75, 78, 79, 83, 84, 85, 86, 87, 90, 91, 92, 93, 94, 95, 99, 100, 101, 103, 104, 105, 106, 107, 110
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).

Examples

			The sequence of terms together with their binary indices begins:
     3: (1,1)          35: (4,1,1)        59: (1,1,2,1,1)
     7: (1,1,1)        36: (3,3)          60: (1,1,1,3)
    10: (2,2)          37: (3,2,1)        61: (1,1,1,2,1)
    11: (2,1,1)        39: (3,1,1,1)      62: (1,1,1,1,2)
    14: (1,1,2)        42: (2,2,2)        63: (1,1,1,1,1,1)
    15: (1,1,1,1)      43: (2,2,1,1)      67: (5,1,1)
    19: (3,1,1)        46: (2,1,1,2)      69: (4,2,1)
    21: (2,2,1)        47: (2,1,1,1,1)    71: (4,1,1,1)
    23: (2,1,1,1)      51: (1,3,1,1)      73: (3,3,1)
    26: (1,2,2)        52: (1,2,3)        74: (3,2,2)
    27: (1,2,1,1)      53: (1,2,2,1)      75: (3,2,1,1)
    28: (1,1,3)        55: (1,2,1,1,1)    78: (3,1,1,2)
    29: (1,1,2,1)      56: (1,1,4)        79: (3,1,1,1,1)
    30: (1,1,1,2)      57: (1,1,3,1)      83: (2,3,1,1)
    31: (1,1,1,1,1)    58: (1,1,2,2)      84: (2,2,3)
		

Crossrefs

The complement is A345167.
These compositions are counted by A345192.
A001250 counts alternating permutations, complement A348615.
A003242 counts anti-run compositions.
A025047 counts alternating or wiggly compositions, directed A025048, A025049.
A344604 counts alternating compositions with twins.
A345194 counts alternating patterns (with twins: A344605).
A345164 counts alternating permutations of prime indices (with twins: A344606).
A345165 counts partitions without a alternating permutation, ranked by A345171.
A345170 counts partitions with a alternating permutation, ranked by A345172.
A348610 counts alternating ordered factorizations, complement A348613.
Statistics of standard compositions:
- Length is A000120.
- Constant runs are A124767.
- Heinz number is A333219.
- Number of maximal anti-runs is A333381.
- Runs-resistance is A333628.
- Number of distinct parts is A334028.
Classes of standard compositions:
- Weakly decreasing compositions (partitions) are A114994.
- Weakly increasing compositions (multisets) are A225620.
- Strict compositions are A233564.
- Constant compositions are A272919.
- Anti-run compositions are A333489.
- Non-anti-run compositions are A348612.

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];
    Select[Range[0,100],Not@*wigQ@*stc]

A348615 Number of non-alternating permutations of {1...n}.

Original entry on oeis.org

0, 0, 0, 2, 14, 88, 598, 4496, 37550, 347008, 3527758, 39209216, 473596070, 6182284288, 86779569238, 1303866853376, 20884006863710, 355267697410048, 6397563946377118, 121586922638606336, 2432161265800164950, 51081039175603191808, 1123862030028821404198
Offset: 0

Views

Author

Gus Wiseman, Nov 03 2021

Keywords

Comments

A sequence is alternating if it is alternately strictly increasing and strictly decreasing, starting with either.
Also permutations of {1...n} matching the consecutive patterns (1,2,3) or (3,2,1). Matching only one of these gives A065429.

Examples

			The a(4) = 14 permutations:
  (1,2,3,4)  (3,1,2,4)
  (1,2,4,3)  (3,2,1,4)
  (1,3,4,2)  (3,4,2,1)
  (1,4,3,2)  (4,1,2,3)
  (2,1,3,4)  (4,2,1,3)
  (2,3,4,1)  (4,3,1,2)
  (2,4,3,1)  (4,3,2,1)
		

Crossrefs

The complement is counted by A001250, ranked by A333218.
The complementary version for compositions is A025047, ranked by A345167.
A directed version is A065429, complement A049774.
The version for compositions is A345192, ranked by A345168.
The version for ordered factorizations is A348613, complement A348610.
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.
A348380 counts factorizations without an alternating permutation.

Programs

  • Maple
    b:= proc(u, o) option remember;
          `if`(u+o=0, 1, add(b(o-1+j, u-j), j=1..u))
        end:
    a:= n-> n!-`if`(n<2, 1, 2)*b(n, 0):
    seq(a(n), n=0..30);  # Alois P. Heinz, Nov 04 2021
  • Mathematica
    wigQ[y_]:=Or[Length[y]==0,Length[Split[y]] ==Length[y]&&Length[Split[Sign[Differences[y]]]]==Length[y]-1];
    Table[Length[Select[Permutations[Range[n]],!wigQ[#]&]],{n,0,6}]
  • Python
    from itertools import accumulate, count, islice
    def A348615_gen(): # generator of terms
        yield from (0,0)
        blist, f = (0,2), 1
        for n in count(2):
            f *= n
            yield f - (blist := tuple(accumulate(reversed(blist),initial=0)))[-1]
    A348615_list = list(islice(A348615_gen(),40)) # Chai Wah Wu, Jun 09-11 2022

Formula

a(n) = n! - A001250(n).

A349053 Number of non-weakly alternating integer compositions of n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 4, 12, 37, 95, 232, 533, 1198, 2613, 5619, 11915, 25011, 52064, 107694, 221558, 453850, 926309, 1884942, 3825968, 7749312, 15667596, 31628516, 63766109, 128415848, 258365323, 519392582, 1043405306, 2094829709, 4203577778, 8431313237, 16904555958
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. Then a sequence is (strongly) alternating iff it is a weakly alternating anti-run.

Examples

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

Crossrefs

Complementary directed versions are A129852/A129853, strong A025048/A025049.
The strong version is A345192.
The complement is counted by A349052.
These compositions are ranked by A349057, strong A345168.
The complementary version for patterns is A349058, strong A345194.
The complementary multiplicative version is A349059, strong A348610.
An unordered version (partitions) is A349061, complement A349060.
The version for ordered prime factorizations is A349797, complement A349056.
The version for patterns is A350138, strong A350252.
The version for ordered factorizations is A350139.
A001250 counts alternating permutations, complement A348615.
A001700 counts compositions of 2n with alternating sum 0.
A003242 counts Carlitz (anti-run) compositions.
A011782 counts compositions, unordered A000041.
A025047 counts alternating compositions, ranked by A345167.
A106356 counts compositions by number of maximal anti-runs.
A344604 counts alternating compositions with twins.
A345164 counts alternating ordered prime factorizations.
A349054 counts strict alternating compositions.

Programs

  • Mathematica
    wwkQ[y_]:=And@@Table[If[EvenQ[m],y[[m]]<=y[[m+1]],y[[m]]>=y[[m+1]]],{m,1,Length[y]-1}]||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],!wwkQ[#]&]],{n,0,10}]

Formula

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

Extensions

a(21)-a(35) from Martin Ehrenstein, Jan 08 2022

A349052 Number of weakly alternating compositions of n.

Original entry on oeis.org

1, 1, 2, 4, 8, 16, 28, 52, 91, 161, 280, 491, 850, 1483, 2573, 4469, 7757, 13472, 23378, 40586, 70438, 122267, 212210, 368336, 639296, 1109620, 1925916, 3342755, 5801880, 10070133, 17478330, 30336518, 52653939, 91389518, 158621355, 275313226, 477850887, 829388075
Offset: 0

Views

Author

Gus Wiseman, Nov 29 2021

Keywords

Comments

We define a sequence to be weakly alternating if it is alternately weakly increasing and weakly decreasing, starting with either. A sequence is alternating iff it is a weakly alternating anti-run.

Examples

			The a(5) = 16 compositions:
  (1,1,1,1,1)  (1,1,1,2)  (1,1,3)  (1,4)  (5)
               (1,1,2,1)  (1,2,2)  (2,3)
               (1,2,1,1)  (1,3,1)  (3,2)
               (2,1,1,1)  (2,1,2)  (4,1)
                          (2,2,1)
                          (3,1,1)
The a(6) = 28 compositions:
  (111111)  (11112)  (1113)  (114)  (15)  (6)
            (11121)  (1122)  (132)  (24)
            (11211)  (1131)  (141)  (33)
            (12111)  (1212)  (213)  (42)
            (21111)  (1311)  (222)  (51)
                     (2121)  (231)
                     (2211)  (312)
                     (3111)  (411)
		

Crossrefs

The strong case is A025047, ranked by A345167.
The directed versions are A129852 and A129853, strong A025048 and A025049.
The complement is counted by A349053, strong A345192.
The version for permutations of prime indices is A349056, strong A345164.
The complement is ranked by A349057, strong A345168.
The version for patterns is A349058, strong A345194.
The multiplicative version is A349059, strong A348610.
An unordered version (partitions) is A349060, complement A349061.
The non-alternating case is A349800, ranked by A349799.
A001250 counts alternating permutations, complement A348615.
A001700 counts compositions of 2n with alternating sum 0.
A003242 counts Carlitz (anti-run) compositions.
A011782 counts compositions.
A106356 counts compositions by number of maximal anti-runs.
A344604 counts alternating compositions with twins.
A345170 counts partitions w/ an alternating permutation, ranked by A345172.
A349054 counts strict alternating compositions.

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[Join@@Permutations/@IntegerPartitions[n],whkQ[#]||whkQ[-#]&]],{n,0,10}]
  • PARI
    C(n,f)={my(M=matrix(n,n,j,k,k>=j), s=M[,n]); for(b=1, n, f=!f; M=matrix(n,n,j,k, if(k1,M[j-k,k-1]) ))); for(k=2, n, M[,k]+=M[,k-1]); s+=M[,n]); s~}
    seq(n) = concat([1], C(n,0) + C(n,1) - vector(n,j,numdiv(j))) \\ Andrew Howroyd, Jan 31 2024

Extensions

a(21)-a(37) from Martin Ehrenstein, Jan 08 2022

A345194 Number of alternating patterns of length n.

Original entry on oeis.org

1, 1, 2, 6, 22, 102, 562, 3618, 26586, 219798, 2018686, 20393790, 224750298, 2683250082, 34498833434, 475237879950, 6983085189454, 109021986683046, 1802213242949602, 31447143854808378, 577609702827987882, 11139837273501641502, 225075546284489412854
Offset: 0

Views

Author

Gus Wiseman, Jun 17 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.
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).
The version with twins (A344605) is identical to this sequence except with a(2) = 3 instead of 2.
From Gus Wiseman, Jan 16 2022: (Start)
Conjecture: Also the number of weakly up/down patterns of length n, where a sequence is weakly up/down if it is alternately weakly increasing and weakly decreasing, starting with an increase. For example, the a(0) = 1 through a(3) = 6 weakly up/down patterns are:
() (1) (1,1) (1,1,1)
(2,1) (1,1,2)
(2,1,1)
(2,1,2)
(2,1,3)
(3,1,2)
(End)

Examples

			The a(0) = 1 through a(3) = 6 alternating patterns:
  ()  (1)  (1,2)  (1,2,1)
           (2,1)  (1,3,2)
                  (2,1,2)
                  (2,1,3)
                  (2,3,1)
                  (3,1,2)
		

Crossrefs

The version for permutations is A001250, complement A348615.
The version for compositions is A025047, complement A345192.
The version with twins (x,x) is A344605.
The version for perms of prime indices is A345164, complement A350251.
The version for factorizations is A348610, complement A348613, weak A349059.
The weak version is A349058, complement A350138, compositions A349052.
The complement is counted by A350252.
A000670 = patterns, ranked by A333217.
A003242 = anti-run compositions.
A005649 = anti-run patterns, complement A069321.
A019536 = necklace patterns.
A129852 and A129853 = up/down and down/up compositions.
A226316 = patterns avoiding (1,2,3), weakly A052709, complement A335515.
A345170 = partitions w/ alternating permutation, complement A345165.
A349055 = normal multisets w/ alternating permutation, complement A349050.

Programs

  • Mathematica
    wigQ[y_]:=Or[Length[y]==0,Length[Split[y]]== Length[y]&&Length[Split[Sign[Differences[y]]]]==Length[y]-1];
    allnorm[n_]:=If[n<=0,{{}},Function[s, Array[Count[s,y_/;y<=#]+1&,n]]/@Subsets[Range[n-1]+1]];
    Table[Length[Select[Join@@Permutations/@allnorm[n],wigQ]],{n,0,6}]
  • PARI
    F(p,x) = {sum(k=0, p, (-1)^((k+1)\2)*binomial((p+k)\2, k)*x^k)}
    R(n,k) = {Vec(if(k==1, x, 2*F(k-2,-x)/F(k-1,x)-2-(k-2)*x) + O(x*x^n))}
    seq(n)= {concat([1], sum(k=1, n, R(n, k)*sum(r=k, n, binomial(r, k)*(-1)^(r-k)) ))} \\ Andrew Howroyd, Feb 04 2022

Formula

a(n) = 2*A350354(n) for n >= 2. - Andrew Howroyd, Feb 04 2022

Extensions

a(10)-a(18) from Alois P. Heinz, Dec 10 2021
Terms a(19) and beyond from Andrew Howroyd, Feb 04 2022

A348379 Number of factorizations of n with an alternating permutation.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 4, 1, 2, 2, 3, 1, 4, 1, 4, 2, 2, 1, 6, 1, 2, 2, 4, 1, 5, 1, 5, 2, 2, 2, 8, 1, 2, 2, 6, 1, 5, 1, 4, 4, 2, 1, 10, 1, 4, 2, 4, 1, 6, 2, 6, 2, 2, 1, 11, 1, 2, 4, 6, 2, 5, 1, 4, 2, 5, 1, 15, 1, 2, 4, 4, 2, 5, 1, 10, 3, 2, 1, 11, 2
Offset: 1

Views

Author

Gus Wiseman, Oct 28 2021

Keywords

Comments

First differs from A335434 at a(216) = 27, A335434(216) = 28. Also differs from A335434 at a(270) = 19, A335434(270) = 20.
A factorization of n is a weakly increasing sequence of positive integers > 1 with product n.
All of the counted factorizations are separable (A335434).
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}.

Examples

			The a(270) = 19 factorizations:
  (2*3*3*15)  (2*3*45)  (2*135)  (270)
  (2*3*5*9)   (2*5*27)  (3*90)
  (3*3*5*6)   (2*9*15)  (5*54)
              (3*3*30)  (6*45)
              (3*5*18)  (9*30)
              (3*6*15)  (10*27)
              (3*9*10)  (15*18)
              (5*6*9)
		

Crossrefs

Partitions not of this type are counted by A345165, ranked by A345171.
Partitions of this type are counted by A345170, ranked by A345172.
Twins and partitions of this type are counted by A344740, ranked by A344742.
The case with twins is A347050.
The complement is counted by A348380, without twins A347706.
The ordered version is A348610.
A001055 counts factorizations, strict A045778, ordered A074206.
A001250 counts alternating permutations.
A025047 counts alternating or wiggly compositions, ranked by A345167.
A339846 counts even-length factorizations.
A339890 counts odd-length factorizations.

Programs

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

Formula

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

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

A349060 Number of integer partitions of n that are constant or whose part multiplicities, except possibly the first and last, are all even.

Original entry on oeis.org

1, 1, 2, 3, 5, 7, 10, 13, 18, 22, 29, 35, 45, 53, 68, 77, 98, 112, 140, 157, 195, 218, 270, 298, 367, 404, 495, 542, 658, 721, 873, 949, 1145, 1245, 1494, 1615, 1934, 2091, 2492, 2688, 3188, 3436, 4068, 4369, 5155, 5537, 6511, 6976, 8186, 8763, 10251, 10962
Offset: 0

Views

Author

Gus Wiseman, Dec 06 2021

Keywords

Comments

Also the number of weakly alternating integer partitions of n, where we define a sequence to be weakly alternating if it is alternately weakly increasing and weakly decreasing, starting with either. This sequence looks at the somewhat degenerate case where no strict increases are allowed.

Examples

			The a(1) = 1 through a(7) = 13 partitions:
  (1)  (2)   (3)    (4)     (5)      (6)       (7)
       (11)  (21)   (22)    (32)     (33)      (43)
             (111)  (31)    (41)     (42)      (52)
                    (211)   (221)    (51)      (61)
                    (1111)  (311)    (222)     (322)
                            (2111)   (411)     (331)
                            (11111)  (2211)    (511)
                                     (3111)    (2221)
                                     (21111)   (4111)
                                     (111111)  (22111)
                                               (31111)
                                               (211111)
                                               (1111111)
		

Crossrefs

Alternating: A025047, ranked by A345167, also A025048 and A025049.
The strong case is A065033, ranked by A167171.
A directed version is A096441.
Non-alternating: A345192, ranked by A345168.
Weakly alternating: A349052, also A129852 and A129853.
Non-weakly alternating: A349053, ranked by A349057.
A version for ordered factorizations is A349059, strong A348610.
The complement is counted by A349061, strong A349801.
These partitions are ranked by the complement of A349794.
The non-strict case is A349795.
A000041 counts integer partitions, ordered A011782.
A001250 counts alternating permutations, complement A348615.
A344604 counts alternating compositions with twins.
A345170 counts partitions w/ an alternating permutation, ranked by A345172.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n], SameQ@@#||And@@EvenQ/@Take[Length/@Split[#],{2,-2}]&]],{n,0,30}]
  • PARI
    A_x(N)={my(x='x+O('x^N), g= 1 + sum(i=1, N, (x^i/(1-x^i)) * (1 + sum(j=i+1, N-i, (x^j/((1-x^j))) / prod(k=1, j-i-1, 1-x^(2*(i+k)))))));
    Vec(g)}
    A_x(52) \\ John Tyler Rascoe, Mar 20 2024

Formula

G.f.: 1 + Sum_{i>0} (x^i/(1-x^i)) * (1 + Sum_{j>i} (x^j/(1-x^j)) / Product_{k=1..j-i-1} (1-x^(2*(i+k)))). - John Tyler Rascoe, Mar 20 2024

A347706 Number of factorizations of n that are not a twin (x*x) nor have an alternating permutation.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Oct 28 2021

Keywords

Comments

First differs from A348381 at a(216) = 4, A348381(216) = 3.
A factorization of n is a weakly increasing sequence of positive integers > 1 with product n.
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.

Examples

			The a(n) factorizations for n = 96, 192, 2160, 576:
  2*2*2*12      3*4*4*4         3*3*3*80       4*4*4*9
  2*2*2*2*6     2*2*2*24        6*6*6*10       2*2*2*72
  2*2*2*2*2*3   2*2*2*2*12      2*2*2*270      2*2*2*2*36
                2*2*2*2*2*6     2*3*3*3*40     2*2*2*2*4*9
                2*2*2*2*3*4     2*2*2*2*135    2*2*2*2*6*6
                2*2*2*2*2*2*3   2*2*2*2*3*45   2*2*2*2*2*18
                                2*2*2*2*5*27   2*2*2*2*3*12
                                2*2*2*2*9*15   2*2*2*2*2*2*9
                                               2*2*2*2*2*3*6
                                               2*2*2*2*2*2*3*3
		

Crossrefs

Positions of nonzero terms are A046099.
Partitions of this type are counted by A344654, ranked by A344653.
Partitions not of this type are counted by A344740, ranked by A344742.
The complement is counted by A347050, without twins A348379.
The version for compositions is A348377.
The version allowing twins is A348380.
The inseparable case is A348381.
A001055 counts factorizations, strict A045778, ordered A074206.
A001250 counts alternating permutations of sets.
A025047 counts alternating or wiggly compositions, ranked by A345167.
A339846 counts even-length factorizations.
A339890 counts odd-length factorizations.
A347438 counts factorizations with alternating product 1, additive A119620.
A348610 counts alternating ordered factorizations.

Programs

  • Mathematica
    facs[n_]:=If[n<=1,{{}},Join@@Table[Map[Prepend[#,d]&,Select[facs[n/d],Min@@#>=d&]],{d,Rest[Divisors[n]]}]];
    Table[Length[Select[facs[n],Function[f,Select[Permutations[f],!MatchQ[#,{_,x_,y_,z_,_}/;x<=y<=z||x>=y>=z]&]=={}]]],{n,100}]

Formula

a(2^n) = A344654(n).
Showing 1-10 of 25 results. Next