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.

A228959 Total sum of squared lengths of ascending runs in all permutations of [n].

This page as a plain text file.
%I A228959 #17 Dec 20 2020 07:31:15
%S A228959 0,1,6,32,186,1222,9086,75882,705298,7231862,81160422,990024466,
%T A228959 13047411482,184788881838,2799459801742,45178128866282,
%U A228959 773829771302946,14021761172671462,267991492197471158,5388234382450264002,113692608262971520042,2512031106415692960926
%N A228959 Total sum of squared lengths of ascending runs in all permutations of [n].
%H A228959 Alois P. Heinz, <a href="/A228959/b228959.txt">Table of n, a(n) for n = 0..200</a>
%F A228959 E.g.f.: (2*exp(x)-x-2)/(x-1)^2.
%F A228959 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.
%F A228959 a(n) ~ n! * (2*exp(1)-3)*n. - _Vaclav Kotesovec_, Sep 12 2013
%e A228959 a(0) = 0: ().
%e A228959 a(1) = 1: (1).
%e A228959 a(2) = 6 = 4+2: (1,2), (2,1).
%e A228959 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).
%p A228959 a:= proc(n) option remember; `if`(n<3, n*(2*n-1),
%p A228959       (2*n+1)*a(n-1) -(n-1)*((n+2)*a(n-2)-(n-2)*a(n-3)))
%p A228959     end:
%p A228959 seq(a(n), n=0..30);
%t A228959 a[n_] := With[{k = 2}, Sum[If[n==t, 1, (n!/(t+1)!)(t(n-t+1)+1-((t+1)(n-t)+1)/(t+2))] t^k, {t, 1, n}]];
%t A228959 a /@ Range[0, 30] (* _Jean-François Alcover_, Dec 20 2020, after _Alois P. Heinz_ in A229001 *)
%Y A228959 Column k=2 of A229001.
%K A228959 nonn
%O A228959 0,3
%A A228959 _Alois P. Heinz_, Sep 09 2013