OFFSET
1,3
COMMENTS
First differences seem to be in A000130. - Ralf Stephan, Aug 28 2003
REFERENCES
F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 264, Table 7.6.2.
N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
Jean-François Alcover, Table of n, a(n) for n = 1..40
EXAMPLE
The permutation 3 2 1 4 5 7 6 has three such runs: 3-2-1, 4-5 and 7-6.
For n<=3 all permutations have one such run. For n=4, 16 have one run, two have no such runs (2413 and 3142), and 6 have two runs (1243, 2134, 2143, 3412, 3421), so a(4) = 16/2 = 8.
MATHEMATICA
S[n_] := S[n] = If[n<4, {1, 1, 2*t, 4*t + 2*t^2}[[n+1]], (n+1-t)* S[n-1] - (1-t)*(n-2+3*t)*S[n-2] - (1-t)^2*(n-5+t)*S[n-3] + (1-t)^3*(n-3)*S[n-4]]; A000239 = Join[{1}, Table[Coefficient[S[n], t, 1]/2, {n, 1, 20}] // Accumulate // Rest] (* Jean-François Alcover, Feb 06 2016, from successive accumulation of A000130 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
Entry revised by N. J. A. Sloane, Apr 14 2014
More terms from Jean-François Alcover, Feb 06 2016
STATUS
approved