login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A181936 Number of 5-alternating permutations. 5
1, 1, 1, 1, 1, 1, 5, 20, 55, 125, 251, 2300, 15775, 70500, 249250, 750751, 10006375, 97226875, 601638125, 2886735625, 11593285251, 202808749375, 2550175096250, 20163891580625, 122209131374375, 613498040952501, 13287626090593750, 205055676105734375 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,7

COMMENTS

For an integer n>0, a permutation s = s_1...s_k is a n-alternating permutation if it has the property that s_i < s_{i+1} if and only if n divides i.

REFERENCES

Anthony Mendes and Jeffrey Remmel, Generating functions from symmetric functions, Preliminary version of book, available from Jeffrey Remmel's home page.

LINKS

Alois P. Heinz, Table of n, a(n) for n = 0..200

R. J. Cano, PARI Sequencer program

Peter Luschny, An old operation on sequences: the Seidel transform

MAPLE

A181936_list := proc(dim) local E, DIM, n, k;

DIM := dim-1; E := array(0..DIM, 0..DIM); E[0, 0] := 1;

for n from 1 to DIM do

if n mod 5 = 0 then E[n, 0] := 0 ;

   for k from n-1 by -1 to 0 do E[k, n-k] := E[k+1, n-k-1] + E[k, n-k-1] od;

else E[0, n] := 0;

   for k from 1 by 1 to n do E[k, n-k] := E[k-1, n-k+1] + E[k-1, n-k] od;

fi od; [E[0, 0], seq(E[k, 0]+E[0, k], k=1..DIM)] end:

A181936_list(28);

# Alternatively, using an exponential generating function:

A181936_list := proc(n) local H, F, i; H := (r, s) -> hypergeom(r, s/5, -(t/5)^5);

F := t -> 1+(t^5*H([1], [6, 7, 8, 9, 10])+5*t^4*H([], [6, 7, 8, 9])+20*t^3*H([], [4, 6, 7, 8])+60*t^2*H([], [3, 4, 6, 7])+120*t^1*H([], [2, 3, 4, 6]))/(120*H([], [2, 3, 4, 1])); seq(i!*coeff(series(F(t), t, n+1), t, i), i=0..n-1) end:

MATHEMATICA

dim = 27; e[0, 0] = 1; e[n_ /; Mod[n, 5] == 0 && 0 <= n <= dim, 0] = 0; e[k_ /; 0 <= k <= dim, n_ /; 0 <= n <= dim] /; Mod[n+k, 5] == 0 := e[k, n] = e[k, n-1] + e[k+1, n-1]; e[0, n_ /; Mod[n, 5] == 0 && 0 <= n <= dim] = 0; e[k_ /; 0 <= k <= dim, n_ /; 0 <= n <= dim] /; Mod[n+k, 5] != 0 := e[k, n] = e[k-1, n] + e[k-1, n+1]; e[_, _] = 0; a[0] = 1; a[n_] := e[n, 0] + e[0, n]; Table[a[n], {n, 0, dim}] (* Jean-François Alcover, Jun 27 2013, translated and adapted from Maple *)

PROG

(Sage)

@cached_function

def A(m, n):

    if n == 0: return 1

    s = -1 if m.divides(n) else 1

    t = [m*k for k in (0..(n-1)//m)]

    return s*add(binomial(n, k)*A(m, k) for k in t)

A181936 = lambda n: (-1)^int(is_odd(n//5))*A(5, n)

print [A181936(n) for n in (0..30)] # Peter Luschny, Jan 24 2017

CROSSREFS

Number of m-alternating permutations: A000012 (m=1), A000111 (m=2), A178963 (m=3), A178964 (m=4), A181936 (m=5).

Cf. A181937.

Sequence in context: A090133 A289306 A062988 * A226639 A264874 A270092

Adjacent sequences:  A181933 A181934 A181935 * A181937 A181938 A181939

KEYWORD

nonn

AUTHOR

Peter Luschny, Apr 03 2012

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 18 22:08 EDT 2019. Contains 322237 sequences. (Running on oeis4.)