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.

User: Per W. Alexandersson

Per W. Alexandersson's wiki page.

Per W. Alexandersson has authored 6 sequences.

A359039 Number of Wachs permutations of size n.

Original entry on oeis.org

1, 1, 2, 4, 8, 24, 48, 192, 384, 1920, 3840, 23040, 46080, 322560, 645120, 5160960, 10321920, 92897280, 185794560, 1857945600, 3715891200, 40874803200, 81749606400, 980995276800, 1961990553600, 25505877196800, 51011754393600, 714164561510400, 1428329123020800
Offset: 0

Author

Per W. Alexandersson, Dec 13 2022

Keywords

Comments

A Wachs permutation pi is a permutation of [n] such that |pi^{-1}(i) - pi^{-1}(i*)| <= 1, for all 1 <= i <= n-1, where i* is defined as i-1 if i is even, i+1 if i is odd and i+1 <= n, and n otherwise.

Examples

			For n=4, a(n)=8, since we have the 8 Wachs permutations 1234, 1243, 2134, 2143, 3412, 3421, 4312, 4321.
		

Crossrefs

Programs

  • Maple
    A359039 := proc(n)
        local m ;
        m := floor(n/2) ;
        if type(n,'even') then
            m!*2^m ;
        else
            (m+1)!*2^m ;
        end if;
    end proc: # R. J. Mathar, Jul 17 2023
    # second Maple program:
    a:= n-> ceil(n/2)!*2^floor(n/2):
    seq(a(n), n=0..28);  # Alois P. Heinz, Dec 21 2023
  • Mathematica
    a[n_]:=If[EvenQ[n], (n/2)! 2^(n/2), ((n + 1)/2)!*2^((n - 1)/2)]

Formula

If n=2m, then a(n) = m!*2^m, if n=2m+1, then a(n) = (m+1)!*2^m.
a(n) = A081123(n+1)*A016116(n). - Alois P. Heinz, Jan 23 2023
Sum_{n>=0} 1/a(n) = 3*sqrt(e) - 2. - Amiram Eldar, Jan 25 2023
D-finite with recurrence a(n) +2*a(n-1) +(-n-1)*a(n-2) +2*(-n+1)*a(n-3)=0. - R. J. Mathar, Jul 17 2023

A356185 The difference between number of even and number of odd Grassmannian permutations of size n.

Original entry on oeis.org

1, 1, 0, 1, 0, 3, 2, 9, 8, 23, 22, 53, 52, 115, 114, 241, 240, 495, 494, 1005, 1004, 2027, 2026, 4073, 4072, 8167, 8166, 16357, 16356, 32739, 32738, 65505, 65504, 131039, 131038, 262109, 262108, 524251, 524250, 1048537, 1048536, 2097111, 2097110, 4194261, 4194260
Offset: 0

Author

Per W. Alexandersson, Jul 28 2022

Keywords

Comments

A permutation is Grassmann if it has at most one descent. A closed-form formula was proved by J. B. Gil and J. A. Tomasko.

Examples

			For n=3, 123, 231, 312 are even Grassmann permutations, and 132, 213 are the odd ones. Hence a(3) = 1.
		

Crossrefs

Bisections give: A005803 (even part), A183155 (odd part).

Programs

  • Mathematica
    Table[2^Floor[1 + (n - 1)/2] - n, {n, 1, 80}]

Formula

a(n) = 2^(1+floor((n-1)/2))-n.
From Alois P. Heinz, Jul 28 2022: (Start)
G.f.: -(4*x^3-3*x^2-x+1)/((2*x^2-1)*(x-1)^2).
a(n) = A000325(n) - A233411(n) = A060546(n) - n = 2^ceiling(n/2) - n.
a(n) = A000325(n) - 2*A032085(n) = A000325(n) - 2*A122746(n-2) for n>=2. (End)

A355089 Number of parity-alternating permutations of [n] avoiding the pattern 123.

Original entry on oeis.org

1, 1, 1, 1, 3, 3, 10, 11, 37, 44, 146, 185, 603, 808, 2576, 3635, 11294, 16736, 50545, 78466, 230012, 373203, 1061236, 1795611, 4953447, 8721086, 23350320, 42691298, 111013825, 210379132, 531720722
Offset: 0

Author

Per W. Alexandersson, Jun 18 2022

Keywords

Comments

A permutation is parity-alternating if it sends odd integers to odd integers, and even integers to even integers. It avoids 123 if there is no subsequence a..b..c with a < b < c. The values are computed by Michael Albert, see MathOverflow link.
The odd-indexed entries agree with the odd-indexed entries in A354208. A bijection is given by reversing the permutation.

Examples

			For n=4, the three permutations are 3412, 3214, 1432.
For n=5, we have 54321, 52143, 32541.
For n=6, we have 563412, 563214, 543612, 543216, 561432, 541632, 365412, 365214, 321654, 165432.
		

Crossrefs

Cf. A000108 (123-avoiding permutations), A010551 (parity-alternating permutations), A354208 (parity-alternating 321-avoiding permutations).

A354208 Number of parity-alternating permutations of [n] avoiding the pattern 321.

Original entry on oeis.org

1, 1, 1, 1, 2, 3, 6, 11, 22, 44, 89, 185, 382, 808, 1702, 3635, 7779, 16736, 36229, 78466, 171238, 373203, 819186, 1795611, 3958662, 8721086, 19294525, 42691298, 94733886, 210379132, 468084856, 1042703207, 2325575076, 5193931583, 11609749877, 25986720374, 58203955771
Offset: 0

Author

Per W. Alexandersson, Jun 06 2022

Keywords

Comments

A permutation is parity-alternating if it sends odd integers to odd integers, and even integers to even integers. It avoids 321 if there is no subsequence a..b..c with a > b > c. The values are computed by Michael Albert, see MathOverflow link.

Examples

			For n=4, the two permutations are 1234, 3412.
For n=5, we have 12345, 34125, 14523.
For n=6, we have 123456, 341256, 145236, 125634, 561234, 345612.
		

Crossrefs

Cf. A000108 (321-avoiding permutations), A010551 (parity-alternating permutations).

Extensions

Offset corrected and terms a(30) and beyond from Peter J. Taylor, Jun 10 2022

A335340 North-East paths from (0,0) to (n,n) with k cyclic descents.

Original entry on oeis.org

2, 4, 2, 6, 12, 2, 8, 36, 24, 2, 10, 80, 120, 40, 2, 12, 150, 400, 300, 60, 2, 14, 252, 1050, 1400, 630, 84, 2, 16, 392, 2352, 4900, 3920, 1176, 112, 2, 18, 576, 4704, 14112, 17640, 9408, 2016, 144, 2, 20, 810, 8640, 35280, 63504, 52920, 20160, 3240, 180, 2
Offset: 1

Author

Per W. Alexandersson, Jun 02 2020

Keywords

Comments

A North-East path is a path from (0,0) to (n,n) using steps (1,0) and (0,1). A cyclic descent is a North step followed by an East step, where the last and first step is a cyclic descent if the path ends with a North step and starts with an East step.
The sum of the entries in row n is equal to binomial(2n,n).
I conjecture that the polynomial Sum_{k=1...n} T(n,k) t^k is real-rooted for all n.

Examples

			The table starts as
2,
4, 2
6, 12, 2
8, 36, 24, 2
10, 80, 120, 40, 2
12, 150, 400, 300, 60, 2
		

Crossrefs

Cf. A103371.

Programs

  • Mathematica
    T[n_, k_] = 2 Binomial[n, k] Binomial[n - 1, k - 1];

Formula

T(n,k) = 2*binomial(n,k)*binomial(n-1,k-1).
T(n,k) = 2 * A103371(n-1,k-1). - Alois P. Heinz, Jun 02 2020

A332389 Number A(n,w) of circular Dyck paths with n entries, and width at most w.

Original entry on oeis.org

1, 1, 2, 1, 4, 3, 1, 8, 7, 4, 1, 16, 18, 10, 5, 1, 32, 47, 28, 13, 6, 1, 64, 123, 82, 38, 16, 7, 1, 128, 322, 244, 117, 48, 19, 8, 1, 256, 843, 730, 370, 152, 58, 22, 9, 1, 512, 2207, 2188, 1186, 496, 187, 68, 25, 10, 1, 1024, 5778, 6562, 3827, 1648, 622, 222, 78, 28, 11
Offset: 1

Author

Per W. Alexandersson, Feb 10 2020

Keywords

Comments

A(n,w) is the number of circular Dyck paths of size n, and width at most w.
This is also the number of circular area lists, a_1, a_2, ..., a_n such that 0 <= a_i <= w-1, and a_{i+1} < a_i + 1, for all 1 <= i <= n, and the index i is taken modulo n.
The values of w are given by the row index.
A(n,w) is given by summing binomial(2*n - 1, n - 1 - (w+2) k) - binomial(2*n - 1, n + j + (w+2)*k) over k=1..w and k over all integers.

Examples

			The table begins as
1,    2,    3,    4,    5, ...
1,    4,    7,    10,   13, ...
1,    8,    18,   28,   38, ...
1,    16,   47,   82,   117, ...
1,    32,   123,  244,  370, ...
...
A(5,3)=123 and a few of the corresponding circular area lists are 00000, 10000,...,12210,...,12222, 22222.
		

Crossrefs

A194460 is the diagonal.

Programs

  • Mathematica
    CircularDyckPaths[n_, w_] := With[{d = w + 2},
       Sum[Binomial[2 n - 1, n - 1 - d s] -
         Binomial[2 n - 1, n + j + d s]
        , {j, w},
        {s, -2 (n + 2), 2 (n + 2)}]
       ];
    Table[
    CircularDyckPaths[n, w]
    , {n, 1, 10}, {w, 1, 10}]

Formula

A(n,w) = Sum_{k=-2*(n+2)..2*(n+2)} Sum_{j=1..w} binomial(2n-1, n-1-(w+2)*k) - binomial(2*n-1, n + j + (w+2)*k).