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

A250261 Number A(n,k) of permutations p of [n] such that p(i) > p(i+1) iff i = 1 + k*m for some m >= 0; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 3, 1, 1, 1, 2, 1, 4, 1, 1, 1, 2, 5, 1, 5, 1, 1, 1, 2, 3, 16, 1, 6, 1, 1, 1, 2, 3, 11, 61, 1, 7, 1, 1, 1, 2, 3, 4, 40, 272, 1, 8, 1, 1, 1, 2, 3, 4, 19, 99, 1385, 1, 9, 1, 1, 1, 2, 3, 4, 5, 78, 589, 7936, 1, 10, 1, 1, 1, 2, 3, 4, 5, 29, 217, 3194, 50521, 1, 11
Offset: 0

Views

Author

Alois P. Heinz, Nov 15 2014

Keywords

Comments

A(n,0) = A(n,k) for k>=n-1 and n>0.

Examples

			Square array A(n,k) begins:
  1, 1,    1,   1,   1,   1,  1, 1, 1, ...
  1, 1,    1,   1,   1,   1,  1, 1, 1, ...
  1, 1,    1,   1,   1,   1,  1, 1, 1, ...
  2, 1,    2,   2,   2,   2,  2, 2, 2, ...
  3, 1,    5,   3,   3,   3,  3, 3, 3, ...
  4, 1,   16,  11,   4,   4,  4, 4, 4, ...
  5, 1,   61,  40,  19,   5,  5, 5, 5, ...
  6, 1,  272,  99,  78,  29,  6, 6, 6, ...
  7, 1, 1385, 589, 217, 133, 41, 7, 7, ...
		

Crossrefs

A(n+3,n+1) = A028387(n).

Programs

  • Maple
    b:= proc(u, o, t, k) option remember; `if`(u+o=0, 1,
         `if`(t=1, add(b(u-j, o+j-1, irem(t+1, k), k), j=1..u),
                   add(b(u+j-1, o-j, irem(t+1, k), k), j=1..o)))
        end:
    A:= (n, k)-> b(0, n, 0, `if`(k=0, n, k)):
    seq(seq(A(n, d-n), n=0..d), d=0..14);
  • Mathematica
    b[u_, o_, t_, k_] := b[u, o, t, k] = If[u+o == 0, 1, If[t == 1, Sum[ b[u-j, o+j-1, Mod[t+1, k], k], {j, 1, u}], Sum[ b[u+j-1, o-j, Mod[t+1, k], k], {j, 1, o}] ] ] ; A[n_, k_] := b[0, n, 0, If[k == 0, n, k]]; Table[Table[A[n, d-n], {n, 0, d}], {d, 0, 14}] // Flatten (* Jean-François Alcover, Feb 03 2015, after Alois P. Heinz *)

A250260 The number of 5-alternating permutations of [n].

Original entry on oeis.org

1, 1, 1, 2, 3, 4, 5, 29, 133, 412, 1041, 2300, 22991, 170832, 822198, 3114489, 10006375, 141705439, 1457872978, 9522474417, 48094772656, 202808749375, 3716808948931, 48860589990687, 403131250565618, 2545098156762649, 13287626090593750
Offset: 0

Views

Author

R. J. Mathar, Nov 15 2014

Keywords

Comments

A sequence a(1), a(2),... is called k-alternating if a(i) > a(i+1) iff i=1 (mod k).

Crossrefs

Cf. A065619 (2-alternating), A249402 (3-alternating), A250259 (4-alternating).
Column k=5 of A250261.

Programs

  • Maple
    # dowupP defined in A250259.
    A250260 :=proc(n)
        downupP(n,4) ;
    end proc:
    seq(A250260(n),n=0..20) ;
    # second Maple program:
    b:= proc(u, o, t) option remember; `if`(u+o=0, 1,
         `if`(t=1, add(b(u-j, o+j-1, irem(t+1, 5)), j=1..u),
                   add(b(u+j-1, o-j, irem(t+1, 5)), j=1..o)))
        end:
    a:= n-> b(0, n, 0):
    seq(a(n), n=0..35);  # Alois P. Heinz, Nov 15 2014
  • Mathematica
    b[u_, o_, t_] := b[u, o, t] = If[u+o == 0, 1, If[t == 1, Sum[b[u-j, o+j-1, Mod[t+1, 5]], {j, 1, u}], Sum[b[u+j-1, o-j, Mod[t+1, 5]], {j, 1, o}]]]; a[n_] := b[0, n, 0]; Table[a[n], {n, 0, 35}] (* Jean-François Alcover, Jun 24 2015, after Alois P. Heinz *)
Showing 1-2 of 2 results.