A000708 a(n) = E(n+1) - 2*E(n), where E(i) is the Euler number A000111(i).
-1, -1, 0, 1, 6, 29, 150, 841, 5166, 34649, 252750, 1995181, 16962726, 154624469, 1505035350, 15583997521, 171082318686, 1985148989489, 24279125761950, 312193418011861, 4210755676649046, 59445878286889709, 876726137720576550, 13483686390543382201
Offset: 0
Keywords
Examples
G.f. = -1 - x + x^3 + 6*x^4 + 29*x^5 + 150*x^6 + 841*x^7 + 5166*x^8 + 34649*x^9 + ... a(3) = 1 with permutation 123. a(4) = 6 with permutations 1243, 1342, 1432, 2341, 2431, 3421. From _Petros Hadjicostas_, Aug 07 2019: (Start) We elaborate on the example above. For the permutations of [3], we have the following sign sequences: 123 -> ++; 132 --> +-; 213 -> -+; 213 -> 213; 231 -> +-; 312 -> -+; 321 --> --. Thus, 123 and 321 are quasi-alternate and a(3) = 2/2 = 1. For the permutations of [4] we have: 1234 -> +++ (neither alternate nor quasi-alternate); 1243 -> ++- (quasi-alternate); 1324 -> +-+ (alternate); 1342 -> ++- (quasi-alternate); 1423 -> +-+ (alternate); 1432 -> +-- (quasi-alternate); 2134 -> -++ (quasi-alternate); 2143 -> -+- (alternate); 2314 -> +-+ (alternate); 2341 -> ++- (quasi-alternate); 2413 -> +-+ (alternate); 2431 -> +-- (quasi-alternate); 3124 -> -++ (quasi-alternate); 3142 -> -+- (alternate); 3214 -> --+ (quasi-alternate); 3241 -> -+- (alternate); 3412 -> +-+ (alternate); 3421 -> +-- (quasi-alternate); 4123 -> -++ (quasi-alternate); 4132 -> -+- (alternate); 4213 -> --+ (quasi-alternate); 4231 -> -+- (alternate); 4312 -> --+ (quasi-alternate); 4321 -> --- (neither alternate nor quasi-alternate). Thus we have 10 = 2*A000111(4) = A001250(4) alternate permutations of [4] and 2*a(4) = 2*6 = 12 quasi-alternate permutations of [4]. The remaining 2 permutations (1234 and 4321) each have one so-called "séquence" ("alternate run"). Thus, P_{n=4, s=1} = 2, P_{n=4, s=2} = 12, and P_{n=4, s=10} = 10 (see row n = 4 for array A059427). (End)
References
- L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 261.
- E. Netto, Lehrbuch der Combinatorik. 2nd ed., Teubner, Leipzig, 1927, p. 113.
- 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
- John Cerkan, Table of n, a(n) for n = 0..482
- Data (data.bnf.fr), Désiré André (1840-1918).
- Désiré André, Mémoire sur les permutations alternées, J. Math. Pur. Appl., 7 (1881), 167-184.
- Désiré André, Étude sur les maxima, minima et séquences des permutations, Annales scientifiques de l'École Normale Supérieure, Serie 3, Vol. 1 (1884), 121-134.
- Désiré André, Mémoire sur les permutations quasi-alternées, Journal de mathématiques pures et appliquées 5e série, tome 1 (1895), 315-350.
- E. Estanave, Sur les coefficients des développements en séries de tang x, séc x et d'autres fonctions. Caractères de périodicité que présentent les chiffres des unités de ces coefficients, Bulletin de la S.M.F., 30 (1902), pp. 220-226.
- F. Morley, A generating function for the number of permutations with an assigned number of sequences, Bull. Amer. Math. Soc. 4 (1897), 23-28. [Discusses the so-called "séquences" of Désiré André. A shifted version of the current sequence appears in column r = 1 in the table on p. 24. His definition, however, of a "run" is highly not standard! The definition of the letter r in his paper is the number of triplets of adjacent numbers in the permutation that appear in order of magnitude (ascending or descending). He proves that in any permutation b of [n] we have r + s = n-1, where s is the number of the so-called "séquences" of André (i.e., number of "alternate runs"). Thus, r = 1 if and only s = n - 2. - _Petros Hadjicostas_, Aug 09 2019]
- Eugen Netto, Lehrbuch der Combinatorik, 1901, Annotated scanned copy of pages 112-113 only.
- Eugen Netto, Lehrbuch der Combinatorik, Verlag von B. G. Teubner, Leipzig, 1901 (archived copy of the whole book).
- Eric Weisstein's MathWorld, Polylogarithm.
Crossrefs
Programs
-
Maple
seq(i! * coeff(series((1 + (tan(t) + sec(t))^2 - 4*(tan(t) + sec(t))) / 2, t, 35), t, i), i=0..24); # Barbara Haas Margolius (margolius(AT)math.csuohio.edu), Mar 12 2001
-
Mathematica
a[ n_] := If[ n < 0, 0, n! SeriesCoefficient[ (1 - 2 Cos[x]) / (1 - Sin[x]), {x, 0, n}]]; (* Michael Somos, Aug 28 2013 *) nmax = 22; ee = Table[2^n*EulerE[n, 1] + EulerE[n], {n, 0, nmax+1}]; dd = Table[Differences[ee, n][[1]] // Abs, {n, 0, nmax+1}]; a[n_] := dd[[n+2]] - 2dd[[n+1]]; a[0] = -1; Table[a[n], {n, 0, nmax}] (* Jean-François Alcover, Feb 10 2016, after Paul Curtz *) Table[If[n == 0, -1, 2 Abs[PolyLog[-n-1, I]] - 4 Abs[PolyLog[-n, I]]], {n, 0, 22}] (* Jean-François Alcover, Jul 01 2017 *)
-
PARI
x='x+O('x^99); Vec(serlaplace((1-2*cos(x))/(1-sin(x))))
-
Python
from mpmath import polylog, j, mp mp.dps=20 def a(n): return -1 if n==0 else int(2*abs(polylog(-n - 1, j)) - 4*abs(polylog(-n, j))) print([a(n) for n in range(23)]) # Indranil Ghosh, Jul 02 2017
-
Python
from itertools import count, islice, accumulate def A000708_gen(): # generator of terms yield -1 blist = (0,1) for n in count(2): yield -2*blist[-1]+(blist:=tuple(accumulate(reversed(blist),initial=0)))[-1] A000708_list = list(islice(A000708_gen(),40)) # Chai Wah Wu, Jun 09-11 2022
Formula
E.g.f.: (1 - 2*cos(x)) / (1 - sin(x)).
a(n) ~ n! * 2*n*(2/Pi)^(n+2). - Vaclav Kotesovec, Oct 08 2013
a(n) = 2*abs(PolyLog(-n-1, i)) - 4*abs(PolyLog(-n, i)) for n > 0, with a(0) = -1. - Jean-François Alcover, Jul 02 2017
Extensions
More terms from Barbara Haas Margolius (margolius(AT)math.csuohio.edu), Mar 12 2001
Corrected and extended by T. D. Noe, Oct 25 2006
Edited by N. J. A. Sloane, Aug 27 2012
Comments