login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A228959 Total sum of squared lengths of ascending runs in all permutations of [n]. 3
0, 1, 6, 32, 186, 1222, 9086, 75882, 705298, 7231862, 81160422, 990024466, 13047411482, 184788881838, 2799459801742, 45178128866282, 773829771302946, 14021761172671462, 267991492197471158, 5388234382450264002, 113692608262971520042, 2512031106415692960926 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

LINKS

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

FORMULA

E.g.f.: (2*exp(x)-x-2)/(x-1)^2.

a(n) = (2*n+1)*a(n-1)-(n-1)*((n+2)*a(n-2)-(n-2)*a(n-3)) for n>=3, a(n) = n*(2*n-1) for n<3.

a(n) ~ n! * (2*exp(1)-3)*n. - Vaclav Kotesovec, Sep 12 2013

EXAMPLE

a(0) = 0: ().

a(1) = 1: (1).

a(2) = 6 = 4+2: (1,2), (2,1).

a(3) = 32 = 9+5+5+5+5+3: (1,2,3), (1,3,2), (2,1,3), (2,3,1), (3,1,2), (3,2,1).

MAPLE

a:= proc(n) option remember; `if`(n<3, n*(2*n-1),

      (2*n+1)*a(n-1) -(n-1)*((n+2)*a(n-2)-(n-2)*a(n-3)))

    end:

seq(a(n), n=0..30);

CROSSREFS

Column k=2 of A229001.

Sequence in context: A259621 A026993 A238115 * A302734 A319228 A216441

Adjacent sequences:  A228956 A228957 A228958 * A228960 A228961 A228962

KEYWORD

nonn

AUTHOR

Alois P. Heinz, Sep 09 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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 15 00:36 EDT 2020. Contains 335762 sequences. (Running on oeis4.)