login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A228614 Number of permutations of [n] having a shortest ascending run of length one. 4
0, 1, 1, 5, 18, 101, 611, 4452, 36287, 333395, 3382758, 37688597, 456839351, 5989023768, 84421235807, 1273482972215, 20470309460322, 349326503482301, 6307682420743595, 120157254334350828, 2408293016265606623, 50663563124372167787, 1116225038923857181614 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,4
LINKS
FORMULA
a(n) = A000142(n) - A097899(n).
E.g.f.: 1/(1-x) - sqrt(3)*exp(-x/2) / (2*cos(sqrt(3)*x/2+Pi/6)).
EXAMPLE
a(1) = 1: 1.
a(2) = 1: 21.
a(3) = 5: 132, 213, 231, 312, 321.
a(4) = 18: 1243, 1342, 1432, 2134, 2143, 2341, 2431, 3124, 3142, 3214, 3241, 3421, 4123, 4132, 4213, 4231, 4312, 4321.
MAPLE
g:= proc(u, o) option remember; `if`(u+o<2, u,
add(b(u-i, o+i-1), i=1..u) +add(g(u+i-1, o-i), i=1..o))
end:
b:= proc(u, o) option remember; `if`(u+o<2, 1-o,
u*(u+o-1)! +add(g(u+i-1, o-i), i=1..o))
end:
a:= n-> add(b(j-1, n-j), j=1..n):
seq(a(n), n=0..25);
MATHEMATICA
g[u_, o_] := g[u, o] = If[u + o < 2, u,
Sum[b[u - i, o + i - 1], {i, u}] +
Sum[g[u + i - 1, o - i], {i, o}]];
b[u_, o_] := b[u, o] = If[u + o < 2, 1 - o, u*(u + o - 1)! +
Sum[g[u + i - 1, o - i], {i, o}]];
a[n_] := Sum[b[j - 1, n - j], {j, n}];
Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Aug 30 2021, after Alois P. Heinz *)
CROSSREFS
Column k=1 of A064315.
Sequence in context: A188329 A165962 A127756 * A158455 A009442 A332784
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Aug 27 2013
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 05:44 EDT 2024. Contains 371918 sequences. (Running on oeis4.)