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.
Ludwig Seidel, Über eine einfache Entstehungsweise der Bernoulli'schen Zahlen und einiger verwandten Reihen, Sitzungsberichte der mathematisch-physikalischen Classe der königlich bayerischen Akademie der Wissenschaften zu München, volume 7 (1877), 157-187. [USA access only through the HATHI TRUST Digital Library]
Ludwig Seidel, Über eine einfache Entstehungsweise der Bernoulli'schen Zahlen und einiger verwandten Reihen, Sitzungsberichte der mathematisch-physikalischen Classe der königlich bayerischen Akademie der Wissenschaften zu München, volume 7 (1877), 157-187. [Access through ZOBODAT]
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 *)
b[u_, o_, t_] := b[u, o, t] = If[u + o == 0, 1, If[t == 0,
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[n, 0, 0];
nmax = 30; CoefficientList[Series[1 + Sum[(x^(5 - k) * HypergeometricPFQ[{1}, {6/5 - k/5, 7/5 - k/5, 8/5 - k/5, 9/5 - k/5, 2 - k/5}, -x^5/3125])/(5 - k)!, {k, 0, 4}] / HypergeometricPFQ[{}, {1/5, 2/5, 3/5, 4/5}, -x^5/3125], {x, 0, nmax}], x] * Range[0, nmax]! (* Vaclav Kotesovec, Apr 21 2021 *)
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
KEYWORD
nonn
AUTHOR
Peter Luschny, Apr 03 2012
STATUS
approved