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-4 of 4 results.

A060350 The sum over all subsets S of [n] of the squares of the number of permutations with descent set = S.

Original entry on oeis.org

1, 1, 2, 10, 88, 1216, 24176, 654424, 23136128, 1035227008, 57186502912, 3822411268864, 304059285928960, 28385946491599360, 3073391215118186496, 381995951933025287680, 54020316243835807039488, 8624091617045072628121600, 1543536018434416280510332928
Offset: 0

Views

Author

Mike Zabrocki, Mar 31 2001

Keywords

Comments

a(n) = number of ordered pairs of permutations of [n] such that the first has an ascent wherever the second has a descent and vice versa. For example, the pair of permutations (1243, 4123) does not qualify because they have a common ascent starting at location 2, and a(2) = 2 counts (12, 21), (21, 12). - David Callan, Sep 15 2013

Examples

			a(1)=1^2; a(2)=1^2+1^2; a(3)=1^2+2^2+2^2+1^2; a(4)=1^2+3^2+5^2+3^2+3^2+5^2+3^2+1^2.
		

Crossrefs

Row sums of A259465.
Column k=2 of A334622.

Programs

  • Maple
    ct := proc(k) option remember; local i,out,n; if k=0 then RETURN(1); fi; n := floor(evalf(log[2](k)))+1; if k=2^n or k=2^(n+1)-1 then RETURN(1); fi; out := 0; for i from 1 to n do if irem(iquo(k, 2^(i-1)), 2) = 1 and irem(iquo(2*k,2^(i-1)),2) =0 then out := out+(n-1)!/(i-1)!/(n-i)!* ct(floor(irem(k,2^(i-1))+2^(i-2)))*ct(iquo(k,2^i)); fi; od; out; end: seq(add(ct(i)^2,i=floor(2^(n-1))..2^n-1), n=0..15);
    # second Maple program:
    b:= proc(u, o, h) option remember; `if`(u+o=0, 1,
          add(add(b(u-j, o+j-1, h+i-1), i=1..u+o-h), j=1..u)+
          add(add(b(u+j-1, o-j, h-i), i=1..h), j=1..o))
        end:
    a:= n-> b(0, n$2):
    seq(a(n), n=0..20);  # Alois P. Heinz, Jul 02 2015
  • Mathematica
    b[u_, o_, h_] := b[u, o, h] = If[u + o == 0, 1, Sum[Sum[b[u - j, o + j - 1, h + i - 1], {i, 1, u + o - h}], {j, 1, u}] + Sum[Sum[b[u + j - 1, o - j, h - i], {i, 1, h}], {j, 1, o}]]; a[n_] := b[0, n, n]; Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Nov 11 2015, after Alois P. Heinz *)

Formula

a(n) = A137782(2n) / A000984(n).
a(n) = Sum_{j=0..ceiling(2^(n-1))-1} A060351(n,j)^2. - Alois P. Heinz, Sep 15 2020
a(n) ~ c * d^n * n!^2, where d = 0.552406011965766199179395470003589240257321... and c = 1.6412834540969426814342654061364... - Vaclav Kotesovec, Sep 18 2020

Extensions

Two more terms from Max Alekseyev, May 06 2009
a(0) prepended, a(18) from Alois P. Heinz, Jul 02 2015

A262372 Number T(n,k) of ordered pairs (p,q) of permutations of [n] with equal up-down signatures and p(1)=q(1)=k if n>0; triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 2, 2, 2, 0, 10, 8, 8, 10, 0, 88, 68, 64, 68, 88, 0, 1216, 952, 852, 852, 952, 1216, 0, 24176, 19312, 17008, 16328, 17008, 19312, 24176, 0, 654424, 533544, 467696, 438496, 438496, 467696, 533544, 654424
Offset: 0

Views

Author

Alois P. Heinz, Sep 20 2015

Keywords

Examples

			T(4,1) = 10: (1234,1234), (1243,1243), (1243,1342), (1324,1324), (1324,1423), (1342,1243), (1342,1342), (1423,1324), (1423,1423), (1432,1432).
T(4,2) = 8: (2134,2134), (2143,2143), (2314,2314), (2314,2413), (2341,2341), (2413,2314), (2413,2413), (2431,2431).
T(4,3) = 8: (3124,3124), (3142,3142), (3142,3241), (3214,3214), (3241,3142), (3241,3241), (3412,3412), (3421,3421).
T(4,4) = 10: (4123,4123), (4132,4132), (4132,4231), (4213,4213), (4213,4312), (4231,4132), (4231,4231), (4312,4213), (4312,4312), (4321,4321).
Triangle T(n,k) begins:
  1
  0,     1;
  0,     1,     1;
  0,     2,     2,     2;
  0,    10,     8,     8,    10;
  0,    88,    68,    64,    68,    88;
  0,  1216,   952,   852,   852,   952,  1216;
  0, 24176, 19312, 17008, 16328, 17008, 19312, 24176;
  ...
		

Crossrefs

Main diagonal and column k=1 give A060350(n-1) for n>0.
Row sums give A262234.
T(2n,n) gives A262379.

Programs

  • Maple
    b:= proc(u, o, h) option remember; `if`(u+o=0, 1,
          add(add(b(u-j, o+j-1, h+i-1), i=1..u+o-h), j=1..u)+
          add(add(b(u+j-1, o-j, h-i), i=1..h), j=1..o))
        end:
    T:= (n, k)-> `if`(k=0, `if`(n=0, 1, 0), b(k-1, n-k, n-k)):
    seq(seq(T(n, k), k=0..n), n=0..10);
  • Mathematica
    b[u_, o_, h_] := b[u, o, h] = If[u + o == 0, 1,
      Sum[b[u - j, o + j - 1, h + i - 1], {i, 1, u + o - h}, {j, 1, u}] +
      Sum[b[u + j - 1, o - j, h - i], {i, 1, h}, {j, 1, o}]];
    T[n_, k_] := If[k == 0, If[n == 0, 1, 0], b[k - 1, n - k, n - k]];
    Table[T[n, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Jean-François Alcover, May 05 2019, after Alois P. Heinz *)

A262233 Number of ordered pairs (p,q) of permutations of [n] with equal up-down signatures and p(1)=1 if n>0.

Original entry on oeis.org

1, 1, 1, 3, 20, 220, 3648, 84616, 2617696, 104112576, 5176135040, 314525766016, 22934467613184, 1976385358538240, 198701625441195520, 23050434113386398720, 3055967615464202301440, 459172688072604359835648, 77616824553405653653094400
Offset: 0

Views

Author

Alois P. Heinz, Sep 15 2015

Keywords

Examples

			a(1) = 1: (1,1).
a(2) = 1: (12,12).
a(3) = 3: (123,123), (132,132), (132,231).
a(4) = 20: (1234,1234), (1243,1243), (1243,1342), (1243,2341), (1324,1324), (1324,1423), (1324,2314), (1324,2413), (1324,3412), (1342,1243), (1342,1342), (1342,2341), (1423,1324), (1423,1423), (1423,2314), (1423,2413), (1423,3412), (1432,1432), (1432,2431), (1432,3421).
		

Crossrefs

Programs

  • Maple
    b:= proc(u, o, h) option remember; `if`(u+o=0, 1,
          add(add(b(u-j, o+j-1, h+i-1), i=1..u+o-h), j=1..u)+
          add(add(b(u+j-1, o-j, h-i), i=1..h), j=1..o))
        end:
    a:= n-> `if`(n=0, 1, add(b(j-1, n-j, n-1), j=1..n)):
    seq(a(n), n=0..20);
  • Mathematica
    b[u_, o_, h_] := b[u, o, h] = If[u + o == 0, 1,
       Sum[Sum[b[u - j, o + j - 1, h + i - 1], {i, 1, u + o - h}], {j, 1, u}]+
       Sum[Sum[b[u + j - 1, o - j, h - i], {i, 1, h}], {j, 1, o}]];
    a[n_] := If[n == 0, 1, Sum[b[j - 1, n - j, n - 1], {j, 1, n}]];
    a /@ Range[0, 20] (* Jean-François Alcover, Jan 02 2021, after Alois P. Heinz *)

Formula

a(n) ~ c * d^n * n!^2 / n, where d = 0.552406011965766199179395470003589240257321... and c = 1.48557711044485933585341072480938... - Vaclav Kotesovec, Sep 18 2020

A262241 Number of ordered pairs (p,q) of permutations of [n] with complementary up-down signatures and p(1)=q(1) if n>0.

Original entry on oeis.org

1, 1, 0, 2, 12, 144, 2456, 58376, 1836064, 73967072, 3714221440, 227511703296, 16699185465088, 1446996011652864, 146157945571218944, 17023105015524481536, 2264733463688117325824, 341323210761171895406592, 57851227793596711612702720
Offset: 0

Views

Author

Alois P. Heinz, Sep 15 2015

Keywords

Comments

1 < p(1) = q(1) < n for n > 1.

Examples

			a(1) = 1: (1,1).
a(2) = 0.
a(3) = 2: (213,231), (231,213).
a(4) = 12: (2134,2431), (2143,2314), (2143,2413), (2314,2143), (2413,2143), (2431,2134), (3124,3421), (3142,3412), (3241,3412), (3412,3142), (3412,3241), (3421,3124).
		

Crossrefs

Programs

  • Maple
    b:= proc(u, o, h) option remember; `if`(u+o=0, 1,
          add(add(b(u-j, o+j-1, h-i), i=1..h), j=1..u)+
          add(add(b(u+j-1, o-j, h+i-1), i=1..u+o-h), j=1..o))
        end:
    a:= n-> `if`(n=0, 1, add(b(j-1, n-j, n-j), j=1..n)):
    seq(a(n), n=0..20);
  • Mathematica
    b[u_, o_, h_] := b[u, o, h] = If[u + o == 0, 1,
         Sum[Sum[b[u - j, o + j - 1, h - i], {i, h}], {j, u}] +
         Sum[Sum[b[u + j - 1, o - j, h + i - 1], {i, u + o - h}], {j, o}]];
    a[n_] := If[n == 0, 1, Sum[b[j - 1, n - j, n - j], {j, n}]];
    Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Aug 30 2021, after Alois P. Heinz *)
Showing 1-4 of 4 results.