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

A096967 Bisection of A096441.

Original entry on oeis.org

0, 2, 4, 7, 11, 17, 26, 37, 54, 76, 106, 145, 199, 266, 357, 472, 621, 809, 1053, 1354, 1740, 2218, 2818, 3559, 4485, 5616, 7018, 8728, 10826, 13373, 16484, 20236, 24793, 30275, 36886, 44810, 54329, 65683, 79265, 95419, 114650, 137447, 164496, 196445, 234221
Offset: 0

Views

Author

N. J. A. Sloane, Aug 20 2004

Keywords

Comments

Number of partitions of 2n such that either all parts are odd or all parts are even, n >= 1. - Omar E. Pol, Aug 16 2013

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(i>n, 0,
          `if`(irem(n, i)=0, 1, 0)+add(`if`(irem(j, 2)=0,
           b(n-i*j, i+1), 0), j=0..n/i))
        end:
    a:= n-> b(2*n, 1):
    seq(a(n), n=0..60);  # Alois P. Heinz, Mar 26 2014
  • Mathematica
    b[n_, i_] := b[n, i] = If[i>n, 0, If[Mod[n, i]==0, 1, 0] + Sum[If[Mod[j, 2] ==0, b[n-i*j, i+1], 0], {j, 0, n/i}]]; a[n_] := b[2*n, 1]; Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Jan 17 2016, after Alois P. Heinz *)

A035363 Number of partitions of n into even parts.

Original entry on oeis.org

1, 0, 1, 0, 2, 0, 3, 0, 5, 0, 7, 0, 11, 0, 15, 0, 22, 0, 30, 0, 42, 0, 56, 0, 77, 0, 101, 0, 135, 0, 176, 0, 231, 0, 297, 0, 385, 0, 490, 0, 627, 0, 792, 0, 1002, 0, 1255, 0, 1575, 0, 1958, 0, 2436, 0, 3010, 0, 3718, 0, 4565, 0, 5604, 0, 6842, 0, 8349, 0, 10143, 0, 12310, 0
Offset: 0

Views

Author

Keywords

Comments

Convolved with A036469 = A000070. - Gary W. Adamson, Jun 09 2009
Note that these partitions are located in the head of the last section of the set of partitions of n (see A135010). - Omar E. Pol, Nov 20 2009
Number of symmetric unimodal compositions of n+2 where the maximal part appears twice, see example. Also number of symmetric unimodal compositions of n where the maximal part appears an even number of times. - Joerg Arndt, Jun 11 2013
Number of partitions of n having parts of even multiplicity. These are the conjugates of the partitions from the definition. Example: a(8)=5 because we have [4,4],[3,3,1,1],[2,2,2,2],[2,2,1,1,1,1], and [1,1,1,1,1,1,1,1]. - Emeric Deutsch, Jan 27 2016
From Gus Wiseman, May 22 2021: (Start)
The Heinz numbers of the conjugate partitions described in Emeric Deutsch's comment above are given by A000290.
For n > 1, also the number of integer partitions of n-1 whose only odd part is the smallest. The Heinz numbers of these partitions are given by A341446. For example, the a(2) = 1 through a(14) = 15 partitions (empty columns shown as dots, A..D = 10..13) are:
1 . 3 . 5 . 7 . 9 . B . D
21 41 43 63 65 85
221 61 81 83 A3
421 441 A1 C1
2221 621 443 643
4221 641 661
22221 821 841
4421 A21
6221 4441
42221 6421
222221 8221
44221
62221
422221
2222221
Also the number of integer partitions of n whose greatest part is the sum of all the other parts. The Heinz numbers of these partitions are given by A344415. For example, the a(2) = 1 through a(12) = 11 partitions (empty columns not shown) are:
(11) (22) (33) (44) (55) (66)
(211) (321) (422) (532) (633)
(3111) (431) (541) (642)
(4211) (5221) (651)
(41111) (5311) (6222)
(52111) (6321)
(511111) (6411)
(62211)
(63111)
(621111)
(6111111)
Also the number of integer partitions of n of length n/2. The Heinz numbers of these partitions are given by A340387. For example, the a(2) = 1 through a(14) = 15 partitions (empty columns not shown) are:
(2) (22) (222) (2222) (22222) (222222) (2222222)
(31) (321) (3221) (32221) (322221) (3222221)
(411) (3311) (33211) (332211) (3322211)
(4211) (42211) (333111) (3332111)
(5111) (43111) (422211) (4222211)
(52111) (432111) (4322111)
(61111) (441111) (4331111)
(522111) (4421111)
(531111) (5222111)
(621111) (5321111)
(711111) (5411111)
(6221111)
(6311111)
(7211111)
(8111111)
(End)

Examples

			From _Joerg Arndt_, Jun 11 2013: (Start)
There are a(12)=11 symmetric unimodal compositions of 12+2=14 where the maximal part appears twice:
01:  [ 1 1 1 1 1 2 2 1 1 1 1 1 ]
02:  [ 1 1 1 1 3 3 1 1 1 1 ]
03:  [ 1 1 1 4 4 1 1 1 ]
04:  [ 1 1 2 3 3 2 1 1 ]
05:  [ 1 1 5 5 1 1 ]
06:  [ 1 2 4 4 2 1 ]
07:  [ 1 6 6 1 ]
08:  [ 2 2 3 3 2 2 ]
09:  [ 2 5 5 2 ]
10:  [ 3 4 4 3 ]
11:  [ 7 7 ]
There are a(14)=15 symmetric unimodal compositions of 14 where the maximal part appears an even number of times:
01:  [ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ]
02:  [ 1 1 1 1 1 2 2 1 1 1 1 1 ]
03:  [ 1 1 1 1 3 3 1 1 1 1 ]
04:  [ 1 1 1 2 2 2 2 1 1 1 ]
05:  [ 1 1 1 4 4 1 1 1 ]
06:  [ 1 1 2 3 3 2 1 1 ]
07:  [ 1 1 5 5 1 1 ]
08:  [ 1 2 2 2 2 2 2 1 ]
09:  [ 1 2 4 4 2 1 ]
10:  [ 1 3 3 3 3 1 ]
11:  [ 1 6 6 1 ]
12:  [ 2 2 3 3 2 2 ]
13:  [ 2 5 5 2 ]
14:  [ 3 4 4 3 ]
15:  [ 7 7 ]
(End)
a(8)=5 because we  have [8], [6,2], [4,4], [4,2,2], and [2,2,2,2]. - _Emeric Deutsch_, Jan 27 2016
From _Gus Wiseman_, May 22 2021: (Start)
The a(0) = 1 through a(12) = 11 partitions into even parts are the following (empty columns shown as dots, A = 10, C = 12). The Heinz numbers of these partitions are given by A066207.
  ()  .  (2)  .  (4)   .  (6)    .  (8)     .  (A)      .  (C)
                 (22)     (42)      (44)       (64)        (66)
                          (222)     (62)       (82)        (84)
                                    (422)      (442)       (A2)
                                    (2222)     (622)       (444)
                                               (4222)      (642)
                                               (22222)     (822)
                                                           (4422)
                                                           (6222)
                                                           (42222)
                                                           (222222)
(End)
		

References

  • Mohammad K. Azarian, A Generalization of the Climbing Stairs Problem, Mathematics and Computer Education, Vol. 31, No. 1, pp. 24-28, Winter 1997. MathEduc Database (Zentralblatt MATH, 1997c.01891).
  • Mohammad K. Azarian, A Generalization of the Climbing Stairs Problem II, Missouri Journal of Mathematical Sciences, Vol. 16, No. 1, Winter 2004, pp. 12-17. Zentralblatt MATH, Zbl 1071.05501.

Crossrefs

Bisection (even part) gives the partition numbers A000041.
Column k=0 of A103919, A264398.
Note: A-numbers of ranking sequences are in parentheses below.
The version for odd instead of even parts is A000009 (A066208).
The version for parts divisible by 3 instead of 2 is A035377.
The strict case is A035457.
The Heinz numbers of these partitions are given by A066207.
The ordered version (compositions) is A077957 prepended by (1,0).
This is column k = 2 of A168021.
The multiplicative version (factorizations) is A340785.
A000569 counts graphical partitions (A320922).
A004526 counts partitions of length 2 (A001358).
A025065 counts palindromic partitions (A265640).
A027187 counts partitions with even length/maximum (A028260/A244990).
A058696 counts partitions of even numbers (A300061).
A067661 counts strict partitions of even length (A030229).
A236913 counts partitions of even length and sum (A340784).
A340601 counts partitions of even rank (A340602).
The following count partitions of even length:
- A096373 cannot be partitioned into strict pairs (A320891).
- A338914 can be partitioned into strict pairs (A320911).
- A338915 cannot be partitioned into distinct pairs (A320892).
- A338916 can be partitioned into distinct pairs (A320912).
- A339559 cannot be partitioned into distinct strict pairs (A320894).
- A339560 can be partitioned into distinct strict pairs (A339561).

Programs

  • Maple
    ZL:= [S, {C = Cycle(B), S = Set(C), E = Set(B), B = Prod(Z,Z)}, unlabelled]: seq(combstruct[count](ZL, size=n), n=0..69); # Zerinvary Lajos, Mar 26 2008
    g := 1/mul(1-x^(2*k), k = 1 .. 100): gser := series(g, x = 0, 80): seq(coeff(gser, x, n), n = 0 .. 78); # Emeric Deutsch, Jan 27 2016
    # Using the function EULER from Transforms (see link at the bottom of the page).
    [1,op(EULER([0,1,seq(irem(n,2),n=0..66)]))]; # Peter Luschny, Aug 19 2020
    # next Maple program:
    a:= n-> `if`(n::odd, 0, combinat[numbpart](n/2)):
    seq(a(n), n=0..84);  # Alois P. Heinz, Jun 22 2021
  • Mathematica
    nmax = 50; s = Range[2, nmax, 2];
    Table[Count[IntegerPartitions@n, x_ /; SubsetQ[s, x]], {n, 0, nmax}] (* Robert Price, Aug 05 2020 *)
  • Python
    from sympy import npartitions
    def A035363(n): return 0 if n&1 else npartitions(n>>1) # Chai Wah Wu, Sep 23 2023

Formula

G.f.: Product_{k even} 1/(1 - x^k).
Convolution with the number of partitions into distinct parts (A000009, which is also number of partitions into odd parts) gives the number of partitions (A000041). - Franklin T. Adams-Watters, Jan 06 2006
If n is even then a(n)=A000041(n/2) otherwise a(n)=0. - Omar E. Pol, Nov 20 2009
G.f.: 1 + x^2*(1 - G(0))/(1-x^2) where G(k) = 1 - 1/(1-x^(2*k+2))/(1-x^2/(x^2-1/G(k+1) )); (recursively defined continued fraction). - Sergei N. Gladkovskii, Jan 23 2013
a(n) = A096441(n) - A000009(n), n >= 1. - Omar E. Pol, Aug 16 2013
G.f.: exp(Sum_{k>=1} x^(2*k)/(k*(1 - x^(2*k)))). - Ilya Gutkovskiy, Aug 13 2018

A122129 Expansion of 1 + Sum_{k>0} x^k^2/((1-x)(1-x^2)...(1-x^(2k))).

Original entry on oeis.org

1, 1, 1, 2, 3, 4, 5, 7, 9, 12, 15, 19, 24, 30, 37, 46, 57, 69, 84, 102, 123, 148, 177, 211, 252, 299, 353, 417, 491, 576, 675, 789, 920, 1071, 1244, 1442, 1670, 1929, 2224, 2562, 2946, 3381, 3876, 4437, 5072, 5791, 6602, 7517, 8551, 9714, 11021, 12493, 14145
Offset: 0

Views

Author

Michael Somos, Aug 21 2006

Keywords

Comments

Generating function arises naturally in Rodney Baxter's solution of the Hard Hexagon Model according to George Andrews.
a(n) = number of SE partitions of n, for n >= 1; see A237981. - Clark Kimberling, Mar 19 2014
In Watson 1937 page 275 he writes "Psi_0(1,q) = prod_1^oo (1+q^{2n}) G(q^8)" so this is the expansion in powers of q^2. - Michael Somos, Jun 28 2015
Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
Rogers-Ramanujan functions: G(x) (see A003114), H(x) (A003106).
From Gus Wiseman, Feb 19 2022: (Start)
This appears to be the number of integer partitions of n with every other pair of adjacent parts strictly decreasing, as in the pattern a > b >= c > d >= e for a partition (a, b, c, d, e). For example, the a(1) = 1 through a(9) = 12 partitions are:
(1) (2) (3) (4) (5) (6) (7) (8) (9)
(21) (31) (32) (42) (43) (53) (54)
(211) (41) (51) (52) (62) (63)
(311) (321) (61) (71) (72)
(411) (322) (422) (81)
(421) (431) (432)
(511) (521) (522)
(611) (531)
(3221) (621)
(711)
(4221)
(32211)
The even-length case is A351008. The odd-length case appears to be A122130. Swapping strictly and weakly decreasing relations appears to give A122135. The alternately unequal and equal case is A351006, strict A035457, opposite A351005, even-length A351007. (End)
Wiseman's first conjecture above was proved by Gordon, Theorem 7. For two other combinatorial interpretations of this sequence see Connor, Proposition 1. - Peter Bala, Dec 22 2024

Examples

			Clark Kimberling's SE partition comment, n=6: the 5 SE partitions are [1,1,1,1,1,1] from the partitions 6 and 1^6; [1,1,1,2,1] from 5,1 and 2,1^4; [1,1,3,1] from 4,2 and 2^2,1^2; [2,3,1] from 3,2,1 and 3^2 and 2^3; and [1,2,2,1] from 4,1^2 and 3,1^3. - _Wolfdieter Lang_, Mar 20 2014
G.f. = 1 + x + x^2 + 2*x^3 + 3*x^4 + 4*x^5 + 5*x^6 + 7*x^7 + 9*x^8 + ...
G.f. = 1/q + q^39 + q^79 + 2*q^119 + 3*q^159 + 4*q^199 + 5*q^239 + ...
		

References

  • G. E. Andrews, q-series, CBMS Regional Conference Series in Mathematics, 66, Amer. Math. Soc. 1986, see p. 8, Eq. (1.7). MR0858826 (88b:11063)
  • G. E. Andrews, R. Askey and R. Roy, Special Functions, Cambridge University Press, 1999; Exercise 6(a), p. 591.

Crossrefs

Programs

  • Maple
    f:=n->1/mul(1-q^(20*k+n),k=0..20);
    f(1)*f(3)*f(4)*f(5)*f(7)*f(9)*f(11)*f(13)*f(15)*f(16)*f(17)*f(19);
    series(%,q,200); seriestolist(%); # N. J. A. Sloane, Mar 19 2012.
    # second Maple program:
    with(numtheory):
    a:= proc(n) option remember; `if`(n=0, 1, add(add(d*[0, 1, 0,
           1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1]
          [1+irem(d, 20)], d=divisors(j)) *a(n-j), j=1..n)/n)
        end:
    seq(a(n), n=0..60);  # Alois P. Heinz, Jul 12 2013
  • Mathematica
    a[0] = 1; a[n_] := a[n] = Sum[Sum[d*{0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1}[[1+Mod[d, 20]]], {d, Divisors[j]}]*a[n-j], {j, 1, n}]/n; Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Jan 10 2014, after Alois P. Heinz *)
    a[ n_] := If[ n < 0, 0, SeriesCoefficient[ Sum[ x^k^2 / QPochhammer[ x, x, 2 k], {k, 0, Sqrt @ n}], {x, 0, n}]]; (* Michael Somos, Jun 28 2015 *)
    a[ n_] := SeriesCoefficient[ 1 / (QPochhammer[ x, x^2] QPochhammer[ x^4, x^20] QPochhammer[ x^16, x^20]), {x, 0, n}]; (* Michael Somos, Jun 28 2015 *)
  • PARI
    {a(n) = if( n<0, 0, polcoeff( sum(k=0, sqrtint(n), x^k^2 / prod(i=1, 2*k, 1 - x^i, 1 + x * O(x^(n-k^2)))), n))};

Formula

Euler transform of period 20 sequence [ 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, ...].
Expansion of f(-x^2) * f(-x^20) / (f(-x) * f(-x^4,-x^16)) in powers of x where f(,) is the Ramanujan general theta function.
Expansion of f(x^3, x^7) / f(-x, -x^4) in powers of x where f(,) is the Ramanujan general theta function. - Michael Somos, Jun 28 2015
Expansion of f(-x^8, -x^12) / psi(-x) in powers of x where psi() is a Ramanujan theta function. - Michael Somos, Jun 28 2015
Expansion of G(x^4) / chi(-x) in powers of x where chi() is a Ramanujan theta function and G() is a Rogers-Ramanujan function. - Michael Somos, Jun 28 2015
G.f.: Sum_{k>=0} x^k^2 / ((1 - x) * (1 - x^2) ... (1 - x^(2*k))).
G.f.: 1 / (Product_{k>0} (1 - x^(2*k-1)) * (1 - x^(20*k-4)) * (1 - x^(20*k-16))).
Let f(n) = 1/Product_{k >= 0} (1 - q^(20k+n)). Then g.f. is f(1)*f(3)*f(4)*f(5)*f(7)*f(9)*f(11)*f(13)*f(15)*f(16)*f(17)*f(19). - N. J. A. Sloane, Mar 19 2012
a(n) is the number of partitions of n into parts that are either odd or == +-4 (mod 20). - Michael Somos, Jun 28 2015
a(n) ~ (3+sqrt(5))^(1/4) * exp(Pi*sqrt(2*n/5)) / (4*sqrt(5)*n^(3/4)). - Vaclav Kotesovec, Aug 30 2015

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

A349061 Number of integer partitions of n with at least one part of odd multiplicity that is not the first or last.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 1, 2, 4, 8, 13, 21, 32, 48, 67, 99, 133, 185, 245, 333, 432, 574, 732, 957, 1208, 1554, 1941, 2468, 3060, 3844, 4731, 5893, 7204, 8898, 10816, 13268, 16043, 19546, 23523, 28497, 34150, 41147, 49106, 58892, 70020, 83597, 99047, 117778, 139087
Offset: 0

Views

Author

Gus Wiseman, Dec 06 2021

Keywords

Comments

Also the number of non-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(6) = 1 through a(10) = 13 partitions:
  (321)  (421)   (431)    (432)     (532)
         (3211)  (521)    (531)     (541)
                 (4211)   (621)     (631)
                 (32111)  (3321)    (721)
                          (4311)    (4321)
                          (5211)    (5311)
                          (42111)   (6211)
                          (321111)  (32221)
                                    (33211)
                                    (43111)
                                    (52111)
                                    (421111)
                                    (3211111)
		

Crossrefs

The strong version for compositions is A345192, ranked by A345168.
The version for compositions is A349053, ranked by A349057.
The complement is counted by A349060.
These partitions are ranked by A349794.
The non-strict case is A349796, complement A349795.
The strong case is A349801.
A000041 counts integer partitions.
A001250 counts alternating permutations, complement A348615.
A003242 counts Carlitz (anti-run) compositions.
A025047 counts alternating compositions, ranked by A345167.
A025048 and A025049 count directed alternating compositions.
A096441 counts weakly alternating 0-appended partitions.
A345170 counts partitions w/ an alternating permutation, ranked by A345172.
A349052 counts weakly alternating compositions.
A349056 counts weakly alternating permutations of prime indices.
A349798 counts weakly but not strongly alternating perms of prime indices.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n], !SameQ@@#&&!And@@EvenQ/@Take[Length/@Split[#],{2,-2}]&]],{n,0,30}]

A349050 Number of multisets of size n that have no alternating permutations and cover an initial interval of positive integers.

Original entry on oeis.org

0, 0, 1, 1, 3, 4, 8, 12, 20, 32, 48, 80, 112, 192, 256, 448, 576, 1024, 1280, 2304, 2816, 5120, 6144, 11264, 13312, 24576, 28672, 53248, 61440, 114688, 131072, 245760, 278528, 524288, 589824, 1114112, 1245184, 2359296, 2621440, 4980736, 5505024
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}.

Examples

			The multiset {1,2,2,2,2,3,3} has no alternating permutations, even though it does have the three anti-run permutations (2,1,2,3,2,3,2), (2,3,2,1,2,3,2), (2,3,2,3,2,1,2), so is counted under a(7).
The a(2) = 1 through a(7) = 12 multisets:
  {11}  {111}  {1111}  {11111}  {111111}  {1111111}
               {1112}  {11112}  {111112}  {1111112}
               {1222}  {12222}  {111122}  {1111122}
                       {12223}  {111123}  {1111123}
                                {112222}  {1122222}
                                {122222}  {1122223}
                                {122223}  {1222222}
                                {123333}  {1222223}
                                          {1222233}
                                          {1222234}
                                          {1233333}
                                          {1233334}
As compositions:
  (2)  (3)  (4)    (5)      (6)      (7)
            (1,3)  (1,4)    (1,5)    (1,6)
            (3,1)  (4,1)    (2,4)    (2,5)
                   (1,3,1)  (4,2)    (5,2)
                            (5,1)    (6,1)
                            (1,1,4)  (1,1,5)
                            (1,4,1)  (1,4,2)
                            (4,1,1)  (1,5,1)
                                     (2,4,1)
                                     (5,1,1)
                                     (1,1,4,1)
                                     (1,4,1,1)
		

Crossrefs

The case of weakly decreasing multiplicities is A025065.
The inseparable case is A336102.
A separable instead of alternating version is A336103.
The version for partitions is A345165.
The version for factorizations is A348380, complement A348379.
The complement (still covering an initial interval) is counted by A349055.
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.
A345170 counts partitions w/ an alternating permutation, ranked by A345172.
A344654 counts partitions w/o an alternating permutation, ranked by A344653.

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, 0, if(n%2==0, (n+2)*2^(n/2-3), (n-1)*2^((n-1)/2-2))) \\ Andrew Howroyd, Jan 13 2024

Formula

a(n) = A011782(n) - A349055(n).
a(n) = (n+2)*2^(n/2-3) for even n > 0; a(n) = (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

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

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

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