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!)
A000111 Euler or up/down numbers: e.g.f. sec(x) + tan(x). Also for n >= 2, half the number of alternating permutations on n letters (A001250).
(Formerly M1492 N0587)
327

%I M1492 N0587 #702 Mar 22 2024 08:45:52

%S 1,1,1,2,5,16,61,272,1385,7936,50521,353792,2702765,22368256,

%T 199360981,1903757312,19391512145,209865342976,2404879675441,

%U 29088885112832,370371188237525,4951498053124096,69348874393137901,1015423886506852352,15514534163557086905,246921480190207983616,4087072509293123892361

%N Euler or up/down numbers: e.g.f. sec(x) + tan(x). Also for n >= 2, half the number of alternating permutations on n letters (A001250).

%C Number of linear extensions of the "zig-zag" poset. See ch. 3, prob. 23 of Stanley. - _Mitch Harris_, Dec 27 2005

%C Number of increasing 0-1-2 trees on n vertices. - _David Callan_, Dec 22 2006

%C Also the number of refinements of partitions. - Heinz-Richard Halder (halder.bichl(AT)t-online.de), Mar 07 2008

%C The ratio a(n)/n! is also the probability that n numbers x1,x2,...,xn randomly chosen uniformly and independently in [0,1] satisfy x1 > x2 < x3 > x4 < ... xn. - _Pietro Majer_, Jul 13 2009

%C For n >= 2, a(n-2) = number of permutations w of an ordered n-set {x_1 < ... x_n} with the following properties: w(1) = x_n, w(n) = x_{n-1}, w(2) > w(n-1), and neither any subword of w, nor its reversal, has the first three properties. The count is unchanged if the third condition is replaced with w(2) < w(n-1). - _Jeremy L. Martin_, Mar 26 2010

%C A partition of zigzag permutations of order n+1 by the smallest or the largest, whichever is behind. This partition has the same recurrent relation as increasing 1-2 trees of order n, by induction the bijection follows. - _Wenjin Woan_, May 06 2011

%C As can be seen from the asymptotics given in the FORMULA section, one has lim_{n->oo} 2*n*a(n-1)/a(n) = Pi; see A132049/A132050 for the simplified fractions. - _M. F. Hasler_, Apr 03 2013

%C a(n+1) is the sum of row n in triangle A008280. - _Reinhard Zumkeller_, Nov 05 2013

%C M. Josuat-Verges, J.-C. Novelli and J.-Y. Thibon (2011) give a far-reaching generalization of the bijection between Euler numbers and alternating permutations. - _N. J. A. Sloane_, Jul 09 2015

%C Number of treeshelves avoiding pattern T321. Treeshelves are ordered binary (0-1-2) increasing trees where every child is connected to its parent by a left or a right link, see A278678 for more definitions and examples. - _Sergey Kirgizov_, Dec 24 2016

%C Number of sequences (e(1), ..., e(n-1)), 0 <= e(i) < i, such that no three terms are equal. [Theorem 7 of Corteel, Martinez, Savage, and Weselcouch] - _Eric M. Schmidt_, Jul 17 2017

%C Number of self-dual edge-labeled trees with n vertices under "mind-body" duality. Also number of self-dual rooted edge-labeled trees with n vertices. See my paper linked below. - _Nikos Apostolakis_, Aug 01 2018

%C The ratio a(n)/n! is the volume of the convex polyhedron defined as the set of (x_1,...,x_n) in [0,1]^n such that x_i + x_{i+1} <= 1 for every 1 <= i <= n-1; see the solutions by Macdonald and Nelsen to the Amer. Math. Monthly problem referenced below. - _Sanjay Ramassamy_, Nov 02 2018

%C Number of total cyclic orders on {0,1,...,n} such that the triple (i-1,i,i+1) is positively oriented for every 1 <= i <= n-1; see my paper on cyclic orders linked below. - _Sanjay Ramassamy_, Nov 02 2018

%C The number of binary, rooted, unlabeled histories with n+1 leaves (following the definition of Rosenberg 2006). Also termed Tajima trees, Tajima genealogies, or binary, rooted, unlabeled ranked trees (Palacios et al. 2015). See Disanto & Wiehe (2013) for a proof. - _Noah A Rosenberg_, Mar 10 2019

%C From _Gus Wiseman_, Dec 31 2019: (Start)

%C Also the number of non-isomorphic balanced reduced multisystems with n + 1 distinct atoms and maximum depth. A balanced reduced multisystem is either a finite multiset, or a multiset partition with at least two parts, not all of which are singletons, of a balanced reduced multisystem. The labeled version is A006472. For example, non-isomorphic representatives of the a(0) = 1 through a(4) = 5 multisystems are (commas elided):

%C {1} {12} {{1}{23}} {{{1}}{{2}{34}}} {{{{1}}}{{{2}}{{3}{45}}}}

%C {{{12}}{{3}{4}}} {{{{1}}}{{{23}}{{4}{5}}}}

%C {{{{1}{2}}}{{{3}}{{45}}}}

%C {{{{1}{23}}}{{{4}}{{5}}}}

%C {{{{12}}}{{{3}}{{4}{5}}}}

%C Also the number of balanced reduced multisystems with n + 1 equal atoms and maximum depth. This is possibly the meaning of Heinz-Richard Halder's comment (see also A002846, A213427, A265947). The non-maximum-depth version is A318813. For example, the a(0) = 1 through a(4) = 5 multisystems are (commas elided):

%C {1} {11} {{1}{11}} {{{1}}{{1}{11}}} {{{{1}}}{{{1}}{{1}{11}}}}

%C {{{11}}{{1}{1}}} {{{{1}}}{{{11}}{{1}{1}}}}

%C {{{{1}{1}}}{{{1}}{{11}}}}

%C {{{{1}{11}}}{{{1}}{{1}}}}

%C {{{{11}}}{{{1}}{{1}{1}}}}

%C (End)

%D M. D. Atkinson: Partial orders and comparison problems, Sixteenth Southeastern Conference on Combinatorics, Graph Theory and Computing, (Boca Raton, Feb 1985), Congressus Numerantium 47, 77-88.

%D Miklos Bona, editor, Handbook of Enumerative Combinatorics, CRC Press, 2015, pages 34, 932.

%D L. Comtet, Advanced Combinatorics, Reidel, 1974, pp. 258-260, section #11.

%D F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 262.

%D Bishal Deb and Alan D. Sokal, Classical continued fractions for some multivariate polynomials generalizing the Genocchi and median Genocchi numbers, arXiv:2212.07232, Dec 14 2022.

%D H. Doerrie, 100 Great Problems of Elementary Mathematics, Dover, NY, 1965, p. 66.

%D O. Heimo and A. Karttunen, Series help-mates in 8, 9 and 10 moves (Problems 2901, 2974-2976), Suomen Tehtavaniekat (Proceedings of the Finnish Chess Problem Society) vol. 60, no. 2/2006, pp. 75, 77.

%D S. K. Jha, A Congruence for the Number of Alternating Permutations, Missouri J. Math. Sci., 33 (No. 1, 2021), 99-104

%D L. B. W. Jolley, Summation of Series. 2nd ed., Dover, NY, 1961, p. 238.

%D S. Mukai, An Introduction to Invariants and Moduli, Cambridge, 2003; see p. 444.

%D E. Netto, Lehrbuch der Combinatorik. 2nd ed., Teubner, Leipzig, 1927, p. 110.

%D C. A. Pickover, The Math Book, Sterling, NY, 2009; see p. 184.

%D N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).

%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

%D R. P. Stanley, Enumerative Combinatorics, Cambridge, Vol. 1, 1997 and Vol. 2, 1999; see Problem 5.7.

%H Seiichi Manyama, <a href="/A000111/b000111.txt">Table of n, a(n) for n = 0..485</a> (terms 0..199 from N. J. A. Sloane)

%H Désiré André, <a href="http://sites.mathdoc.fr/JMPA/PDF/JMPA_1881_3_7_A10_0.pdf">Mémoire sur les permutations alternées</a>, J. Math. Pur. Appl., 7 (1881), 167-184.

%H Nikos Apostolakis, <a href="https://arxiv.org/abs/1804.01214">A duality for labeled graphs and factorizations with applications to graph embeddings and Hurwitz enumeration</a>, arXiv:1804.01214 [math.CO], 2018.

%H Joerg Arndt, <a href="http://www.jjj.de/fxt/#fxtbook">Matters Computational (The Fxtbook)</a>, pp. 281-282.

%H V. I. Arnold, <a href="http://dx.doi.org/10.1215/S0012-7094-91-06323-4">Bernoulli-Euler updown numbers associated with function singularities, their combinatorics and arithmetics</a>, Duke Math. J. 63 (1991), 537-555.

%H J. L. Arregui, <a href="http://arXiv.org/abs/math.NT/0109108">Tangent and Bernoulli numbers related to Motzkin and Catalan numbers by means of numerical triangles</a>, arXiv:math/0109108 [math.NT], 2001.

%H M. D. Atkinson, <a href="https://doi.org/10.1016/0020-0190(85)90057-2">Zigzag permutations and comparisons of adjacent elements</a>, Information Processing Letters 21 (1985), 187-189.

%H Stefano Barbero, Umberto Cerruti, and Nadir Murru, <a href="https://arxiv.org/abs/1710.05665">Some combinatorial properties of the Hurwitz series ring</a> arXiv:1710.05665 [math.NT], 2017.

%H Jean-Luc Baril, Sergey Kirgizov and Vincent Vajnovszki, <a href="https://arxiv.org/abs/1611.07793">Patterns in treeshelves</a>, arXiv:1611.07793 [cs.DM], 2016.

%H Paul Barry, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL15/Barry3/barry84r2.html">A Note on Three Families of Orthogonal Polynomials defined by Circular Functions, and Their Moment Sequences</a>, Journal of Integer Sequences, Vol. 15 (2012), #12.7.2.

%H B. Bauslaugh and F. Ruskey, <a href="https://doi.org/10.1007/BF01932127">Generating alternating permutations lexicographically</a>, Nordisk Tidskr. Informationsbehandling (BIT) 30 16-26 1990.

%H F. Bergeron, M. Bousquet-Mélou, and S. Dulucq, <a href="http://www.labmath.uqam.ca/~annales/volumes/19-2/PDF/139-151.pdf">Standard paths in the composition poset</a>, Ann. Sci. Math. Quebec, 19 (1995), no. 2, 139-151.

%H O. Bodini, M. Dien, X. Fontaine, A. Genitrini and H. K. Hwang, <a href="https://doi.org/10.1007/978-3-662-49529-2_16">Increasing Diamonds</a>, in LATIN 2016: 12th Latin American Symposium, Ensenada, Mexico, April 11-15, 2016, Proceedings Pages pp 207-219 2016 DOI 10.1007/978-3-662-49529-2_16; Lecture Notes in Computer Science Series Volume 9644.

%H J. M. Borwein and S. T. Chapman, <a href="http://www.jstor.org/stable/10.4169/amer.math.monthly.122.03.195">I Prefer Pi: A Brief History and Anthology of Articles in the American Mathematical Monthly</a>, Amer. Math. Monthly, 122 (2015), 195-216.

%H Graham Brightwell, Gérard Cohen, Emanuela Fachini, Marianne Fairthorne, János Körner, Gábor Simonyi and Ágnes Tóth, <a href="https://doi.org/10.1137/090765407">Permutation capacities of families of oriented infinite paths</a>, SIAM J. Discrete Math. 24 (2010), no. 2, 441-456.

%H David Callan, <a href="http://www.stat.wisc.edu/~callan/papersother/">A note on downup permutations and increasing 0-1-2 trees</a>.

%H Peter J. Cameron and Liam Stott, <a href="https://arxiv.org/abs/2010.14902">Trees and cycles</a>, arXiv:2010.14902 [math.CO], 2020. See p. 12.

%H Lorenzo Cappello and Julia A. Palacios, <a href="https://arxiv.org/abs/1902.05527">Sequential importance sampling for multi-resolution Kingman-Tajima coalescent counting</a>, arXiv:1902.05527 [stat.AP], 2019.

%H Swee Hong Chan and Igor Pak, <a href="https://arxiv.org/abs/2308.10214">Computational complexity of counting coincidences</a>, arXiv:2308.10214 [math.CO], 2023. See p. 16.

%H Xiao-Min Chen, X.-K. Chang, J.-Q. Sun, X./-B. Hu and Y.-N. Yeh, <a href="https://www.researchgate.net/publication/278333903_Three_semi-discrete_integrable_systems_related_to_orthogonal_polynomials_and_their_generalized_determinant_solutions">Three semi-discrete integrable systems related to orthogonal polynomials and their generalized determinant solutions</a>, Nonlinearity, Volume 28, Number 7, Jun 08 2015.

%H Suyoung Choi, B. Park and H. Park, <a href="http://arxiv.org/abs/1602.05406">The Betti numbers of real toric varieties associated to Weyl chambers of type B</a>, arXiv preprint arXiv:1602.05406 [math.AT], 2016.

%H Suyoung Choi and Younghan Yoon, <a href="https://arxiv.org/abs/2308.12693">The cohomology rings of real permutohedral varieties</a>, arXiv:2308.12693 [math.AT], 2023.

%H Sean Cleary, Mareike Fischer, Robert C. Griffiths and Raazesh Sainudiin, <a href="http://lamastex.org/preprints/20151231_SomeDistsFRBTrees.pdf">Some distributions on finite rooted binary trees</a>, UCDMS Research Report NO. UCDMS2015/2, School of Mathematics and Statistics, University of Canterbury, Christchurch, NZ, 2015.

%H C. K. Cook, M. R. Bacon, and R. A. Hillman, <a href="https://www.fq.math.ca/Papers1/55-3/CookBaconHillman01222017.pdf">Higher-order Boustrophedon transforms for certain well-known sequences</a>, Fib. Q., 55(3) (2017), 201-208.

%H Jane Ivy Coons and Seth Sullivant, <a href="https://arxiv.org/abs/1805.04175">The Cavender-Farris-Neyman Model with a Molecular Clock</a>, arXiv:1805.04175 [math.AG], 2018.

%H Jane Ivy Coons and Seth Sullivant, <a href="https://arxiv.org/abs/1901.07443">The h*-polynomial of the order polytope of the zig-zag poset</a>, arXiv:1901.07443 [math.CO], 2019.

%H Sylvie Corteel, Megan A. Martinez, Carla D. Savage and Michael Weselcouch, <a href="http://arxiv.org/abs/1510.05434">Patterns in Inversion Sequences I</a>, arXiv:1510.05434 [math.CO], 2015

%H Chandler Davis, <a href="https://www.jstor.org/stable/2308848?seq=1#page_scan_tab_contents">Problem 4755</a>, Amer. Math. Monthly, 64 (1957) 596; <a href="https://www.jstor.org/stable/2308592">solution</a> by W. J. Blundon, 65 (1958), 533-534. [Denoted by P_n in solution.]

%H Chandler Davis, <a href="/A000111/a000111_2.pdf">Problem 4755: A Permutation Problem</a>, Amer. Math. Monthly, 64 (1957) 596; solution by W. J. Blundon, 65 (1958), 533-534. [Denoted by P_n in solution.] [Annotated scanned copy]

%H Colin Defant and James Propp, <a href="https://arxiv.org/abs/2002.07144">Quantifying Noninvertibility in Discrete Dynamical Systems</a>, arXiv:2002.07144 [math.CO], 2020.

%H Karel Devriendt, Renaud Lambiotte and Piet Van Mieghem, <a href="https://arxiv.org/abs/1909.11282">Constructing Laplacian matrices with Soules vectors: inverse eigenvalue problem and applications</a>, arXiv:1909.11282 [physics.soc-ph], 2019.

%H Filippo Disanto and Thomas Wiehe, <a href="http://arxiv.org/abs/1112.1295">Some combinatorial problems on binary rooted trees occurring in population genetics</a>, arXiv preprint arXiv:1112.1295 [math.CO], 2011.

%H Filippo Disanto, <a href="http://arxiv.org/abs/1202.1139">André permutations of the second kind associated to strictly binary increasing trees and left to right minima in their sub-permutations</a>, arXiv preprint arXiv:1202.1139 [math.CO], 2012.

%H Filippo Disanto and Thomas Wiehe, <a href="https://doi.org/10.1016/j.mbs.2013.01.010">Exact enumeration of cherries and pitchforks in ranked trees under the coalescent model</a>, Math. Biosci. 242 (2013), 195-200.

%H R. Donaghey, <a href="http://dx.doi.org/10.1016/0097-3165(75)90002-3">Alternating permutations and binary increasing trees</a>, J. Combinatorial Theory Ser. A 18 (1975), 141--148.MR0360299 (50 #12749)

%H O. Dovgoshey, E. Petrov and H.-M. Teichert, <a href="http://arxiv.org/abs/1412.1978">On spaces extremal for the Gomory-Hu inequality</a>, arXiv preprint arXiv:1412.1979 [math.AG], 2014.

%H D. Dumont and G. Viennot, <a href="/A110501/a110501.pdf">A combinatorial interpretation of the Seidel generation of Genocchi numbers</a>, Preprint, Annotated scanned copy.

%H Richard Ehrenborg and N. Bradley Fox, <a href="http://arxiv.org/abs/1408.6858">The Descent Set Polynomial Revisited</a>, arXiv:1408.6858 [math.CO], 2014. See Table 4.

%H N. D. Elkies, <a href="http://arXiv.org/abs/math.CA/0101168">On the sums Sum((4k+1)^(-n),k,-inf,+inf)</a>, arXiv:math/0101168 [math.CA], 2001-2003.

%H N. D. Elkies, <a href="https://www.jstor.org/stable/3647742">On the sums Sum_{k = -infinity .. infinity} (4k+1)^(-n)</a>, Amer. Math. Monthly, 110 (No. 7, 2003), 561-573.

%H N. D. Elkies, <a href="https://doi.org/10.37236/1896">New Directions in Enumerative Chess Problems</a>, The Electronic Journal of Combinatorics, vol. 11(2), 2004.

%H Eugène Estanave, <a href="https://doi.org/10.24033/bsmf.695">Sur les coefficients des développements en séries de tangx, sécx et d’autres fonctions. Leur expression à l’aide d’un déterminant unique</a>, Bulletin de la Société Mathématique de France, Tome 31 (1903), pp. 203-208.

%H P. Flajolet, S. Gerhold and B. Salvy, <a href="http://arxiv.org/abs/math/0501379">On the non-holonomic character of logarithms, powers and the n-th prime function</a>, arXiv:math/0501379 [math.CO], 2005.

%H P. Flajolet and R. Sedgewick, <a href="http://algo.inria.fr/flajolet/Publications/AnaCombi/anacombi.html">Analytic Combinatorics</a>, 2009.

%H D. Foata and M.-P. Schutzenberger, <a href="http://www-igm.univ-mlv.fr/~berstel/Mps/Travaux/A/1973NombresEulerPermAlternantesColorado.pdf">Nombres d'Euler et permutations alternantes</a>, in J. N. Srivastava et al., eds., A Survey of Combinatorial Theory (North Holland Publishing Company, Amsterdam, 1973), pp. 173-187.

%H Dominique Foata and Guo-Niu Han, <a href="http://www-irma.u-strasbg.fr/~foata/paper/pub123Seidel.pdf">Seidel Triangle Sequences and Bi-Entringer Numbers</a>, November 20, 2013.

%H Jithin D. George, David I. Ketcheson and Randall J. LeVeque, <a href="https://arxiv.org/abs/1901.04158">A characteristics-based approximation for wave scattering from an arbitrary obstacle in one dimension</a>, arXiv:1901.04158 [math.AP], 2019.

%H S. N. Gladkovskii, <a href="http://arxiv.org/abs/1208.2243">On the continued fraction expansion for functions 1/sin(x) + cot(x) and sec(x) + tan(x)</a>, arXiv:1208.2243 [math.HO], 2012.

%H Claude Godrèche and Jean-Marc Luck, <a href="https://arxiv.org/abs/1907.07598">Records for the moving average of a time series</a>, arXiv:1907.07598 [cond-mat.stat-mech], 2019.

%H W. S. Gray and M. Thitsa, <a href="http://dx.doi.org/10.1109/SSST.2013.6524939">System Interconnections and Combinatorial Integer Sequences</a>, in: System Theory (SSST), 2013 45th Southeastern Symposium on, Date of Conference: 11-11 Mar 2013

%H Heinz-Richard Halder, <a href="https://doi.org/10.1007/BF01849788">Über Verfeinerungen von Partitionen</a>, Periodica Mathematica Hungarica Vol. 12 (3), (1981), pp. 217-220.

%H Guo-Niu Han, <a href="https://arxiv.org/abs/1906.00103">Hankel Continued fractions and Hankel determinants of the Euler numbers</a>, arXiv:1906.00103 [math.CO], 2019.

%H F. Heneghan and T. K. Petersen, <a href="http://math.depaul.edu/tpeter21/MaxMinUpDownCMJ2v.pdf">Power series for up-down min-max permutations</a>, 2013.

%H Aoife Hennessy, <a href="http://repository.wit.ie/1693/1/AoifeThesis.pdf">A Study of Riordan Arrays with Applications to Continued Fractions, Orthogonal Polynomials and Lattice Paths</a>, Ph. D. Thesis, Waterford Institute of Technology, Oct. 2011.

%H B. R. Jones, <a href="http://summit.sfu.ca/item/14554">On tree hook length formulas, Feynman rules and B-series</a>, Master's thesis, Simon Fraser University, 2014.

%H M. Josiat-Verges, <a href="http://arxiv.org/abs/1011.0929">Enumeration of snakes and cycle-alternating permutations</a>, arXiv:1011.0929 [math.CO], 2010.

%H M. Josuat-Verges, J.-C. Novelli and J.-Y. Thibon, <a href="http://arxiv.org/abs/1110.5272">The algebraic combinatorics of snakes</a>, arXiv preprint arXiv:1110.5272 [math.CO], 2011.

%H A. A. Kirillov, <a href="https://www.researchgate.net/publication/268247317_Two_More_Variations_on_the_Triangular_Theme">Variations on the triangular theme</a>, Amer. Math. Soc. Transl., (2), Vol. 169, 1995, pp. 43-73, see p. 52.

%H Masato Kobayashi, <a href="https://arxiv.org/abs/1908.00701">A new refinement of Euler numbers on counting alternating permutations</a>, arXiv:1908.00701 [math.CO], 2019.

%H G. Kreweras, <a href="http://www.numdam.org/item?id=MSH_1976__53__5_0">Les préordres totaux compatibles avec un ordre partiel</a>, Math. Sci. Humaines No. 53 (1976), 5-30.

%H G. Kreweras, <a href="/A019538/a019538.pdf">Les préordres totaux compatibles avec un ordre partiel</a>, Math. Sci. Humaines No. 53 (1976), 5-30. (Annotated scanned copy)

%H Dmitry Kruchinin, <a href="http://arxiv.org/abs/1211.2100">Integer properties of a composition of exponential generating functions</a>, arXiv:1211.2100 [math.NT], 2012.

%H Vladimir Victorovich Kruchinin, <a href="http://arxiv.org/abs/1009.2565">Composition of ordinary generating functions</a>, arXiv:1009.2565 [math.CO], 2010.

%H Daeseok Lee and H.-K. Ju, <a href="http://arxiv.org/abs/1503.05658">An Extension of Hibi's palindromic theorem</a>, arXiv preprint arXiv:1503.05658 [math.CO], 2015.

%H Tamás Lengyel, <a href="https://www.emis.de/journals/JIS/VOL22/Lengyel/lengyel7.html">A Note on a Permutation Statistic</a>, J. Int. Seq., Vol. 22 (2019), Article 19.5.1.

%H F. Luca and P. Stanica, <a href="http://calhoun.nps.edu/bitstream/handle/10945/29605/LucaStanicaJCNTfinal.pdf">On some conjectures on the monotonicity of some arithmetical sequences</a>, J. Combin. Number Theory 4 (2012) 1-10.

%H J. M. Luck, <a href="http://arxiv.org/abs/1309.7764">On the frequencies of patterns of rises and falls</a>, arXiv preprint arXiv:1309.7764 [cond-mat.stat-mech], 2013.

%H Peter Luschny, <a href="http://www.luschny.de/math/primes/eulerinc.html">Approximation, inclusion and asymptotics of the Euler numbers.</a>

%H Peter Luschny, <a href="http://oeis.org/wiki/User:Peter_Luschny/SeidelTransform">An old operation on sequences: the Seidel transform</a>

%H Peter Luschny, <a href="/A000111/a000111.jpg">Illustration: Interpolating the Euler-André numbers.</a>

%H Peter Luschny, <a href="https://arxiv.org/abs/2009.06743">An introduction to the Bernoulli function</a>, arXiv:2009.06743 [math.HO], 2020.

%H I. G. Macdonald and R. B. Nelsen (independently), <a href="https://www.jstor.org/stable/2321106">Solution to E2701</a>, Amer. Math. Monthly, 86 (1979), 396.

%H C. L. Mallows, <a href="/A000111/a000111_1.pdf">Letter to N. J. A. Sloane, no date</a>

%H Toufik Mansour, Howard Skogman and Rebecca Smith, <a href="https://arxiv.org/abs/1808.04199">Passing through a stack k times with reversals</a>, arXiv:1808.04199 [math.CO], 2018.

%H J. L. Martin and J. D. Wagner, <a href="https://doi.org/10.37236/171">Updown numbers and the initial monomials of the slope variety</a>, Electronic J. Combin. 16, no. 1 (2009), Research Paper R82. [From _Jeremy L. Martin_, Mar 26 2010]

%H Megan A. Martinez and Carla D. Savage, <a href="https://arxiv.org/abs/1609.08106">Patterns in Inversion Sequences II: Inversion Sequences Avoiding Triples of Relations</a>, arXiv:1609.08106 [math.CO], 2016.

%H A. Mendes, <a href="http://www.jstor.org/stable/27642223">A note on alternating permutations</a>, Amer. Math. Monthly, 114 (2007), 437-440.

%H J. Millar, N. J. A. Sloane and N. E. Young, A new operation on sequences: the Boustrophedon transform, J. Combin. Theory, 17A 44-54 1996 (<a href="http://neilsloane.com/doc/bous.txt">Abstract</a>, <a href="http://neilsloane.com/doc/bous.pdf">pdf</a>, <a href="http://neilsloane.com/doc/bous.ps">ps</a>).

%H A. Morales, I. Pak and G. Panova, <a href="http://arxiv.org/abs/1512.08348">Hook formulas for skew shapes I. q-analogues and bijections</a>, arXiv preprint arXiv:1512.08348 [math.CO], 2015.

%H Alejandro H. Morales, I. Pak, and G. Panova, <a href="http://math.ucla.edu/~ahmorales/papers/EulerFib4.pdf">Why is pi < 2 phi?</a>, Preprint, 2016.

%H F. Murtagh, <a href="https://doi.org/10.1016/0166-218X(84)90066-0">Counting dendrograms: a survey</a>, Discrete Applied Mathematics, 7 (1984), 191-199.

%H D. J. Newman, W. Weissblum and others, <a href="http://www.jstor.org/stable/2027315">Problem 67-5: "Up-Down" Permutations</a>, SIAM Review, Vol. 9, No. 1 (Jan., 1967), page 121, Vol. 11, No. 1 (Jan., 1969), p. 75, and Vol. 10, No. 2 (Apr., 1968), pp. 225-226. [<a href="/A000111/a000111_3.pdf">Annotated scanned copy</a>]

%H A. Niedermaier and J. Remmel, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL13/Remmel/remmel.html">Analogues of Up-down Permutations for Colored Permutations</a>, J. Int. Seq. 13 (2010), 10.5.6., C(t), D(t).

%H E. Norton, <a href="http://arxiv.org/abs/1302.5411">Symplectic Reflection Algebras in Positive Characteristic as Ore Extensions</a>, arXiv preprint arXiv:1302.5411 [math.RA], 2013.

%H I. Pak and A. Soffer, <a href="http://arxiv.org/abs/1507.00411">On Higman's k(U_n(F_q)) conjecture</>, arXiv preprint arXiv:1507.00411 [math.CO], 2015.

%H J. Palacios, J. Wakeley and S. Ramachandran, <a href="https://doi.org/10.1534/genetics.115.177980">Bayesian nonparametric inference of population size changes from sequential genealogies</a>, Genetics 201 (2015), 281-304.

%H Qiong Qiong Pan and Jiang Zeng, <a href="https://arxiv.org/abs/1910.01747">The gamma-coefficients of Branden's (p,q)-Eulerian polynomials and André permutations</a>, arXiv:1910.01747 [math.CO], 2019.

%H S. Ramassamy, <a href="https://arxiv.org/abs/1712.08666">Modular periodicity of the Euler numbers and a sequence by Arnold</a>, arXiv:1712.08666 [math.CO], 2017.

%H S. Ramassamy, <a href="https://doi.org/10.37236/7145">Extensions of partial cyclic orders, Euler numbers and multidimensional boustrophedons</a>, Electron. J. Combin., 25 (2018), #P1.66.

%H A. Randrianarivony and J. Zeng, <a href="http://dx.doi.org/10.1016/0097-3165(94)90092-2">Sur une extension des nombres d'Euler et les records des permutations alternantes</a>, J. Combin. Theory Ser. A 68 (1994), 68-99.

%H A. Randrianarivony and J. Zeng, <a href="http://dx.doi.org/10.1006/aama.1996.0001">Une famille de polynomes qui interpole plusieurs suites...</a>, Adv. Appl. Math. 17 (1996), 1-26.

%H Jeffrey B. Remmel, <a href="https://doi.org/10.1007/s00026-012-0150-9">Generating functions for alternating descents and alternating major index</a>, Ann. Comb. 16 (2012), no. 3, 625-650. MR2960023.

%H N. A. Rosenberg, <a href="https://doi.org/10.1007/s00026-006-0278-6">The mean and variance of the numbers of r-pronged nodes and r-caterpillars in Yule-generated genealogical trees</a>, Ann. Combinator., 10 (2006), 129-146.

%H Y. Sano, <a href="http://dx.doi.org/10.1016/j.disc.2006.11.019">The principal numbers of K. Saito for the types A_l, D_l and E_l</a>, Discr. Math., 307 (2007), 2636-2642.

%H L. Seidel, <a href="https://www.zobodat.at/pdf/Sitz-Ber-Akad-Muenchen-math-Kl_1877_0157-0187.pdf">Über eine einfache Entstehungsweise der Bernoulli'schen Zahlen und einiger verwandten Reihen</a>, Sitzungsberichte der mathematisch-physikalischen Classe der königlich bayerischen Akademie der Wissenschaften zu München, vol. 7 (1877), 157-187.

%H B. Shapiro and A. Vainshtein, <a href="http://dx.doi.org/10.1016/S0196-8858(02)00536-5">On the number of connected components in the space of M-polynomials in hyperbolic functions</a> Adv. in Ap. Math., Vol. 30, Issues 1-2, Feb. 2003, pp. 273-282 (Added by _Tom Copeland_, Oct 04 2015)

%H Heesung Shin and Jiang Zeng, <a href="https://arxiv.org/abs/2006.00507">More bijections for Entringer and Arnold families</a>, arXiv:2006.00507 [math.CO], 2020.

%H N. J. A. Sloane, <a href="http://neilsloane.com/doc/sg.txt">My favorite integer sequences</a>, in Sequences and their Applications (Proceedings of SETA '98).

%H Alan D. Sokal, <a href="https://arxiv.org/abs/1804.04498">The Euler and Springer numbers as moment sequences</a>, arXiv:1804.04498 [math.CO], 2018.

%H J. Staib, <a href="http://www.jstor.org/stable/2690198">Trigonometric power series</a>, Math. Mag., 49 (1976), 147-148.

%H R. P. Stanley, <a href="http://www-math.mit.edu/~rstan/papers.html#queue">Queue problems revisited</a>, Suomen Tehtavaniekat (Proceedings of the Finnish Chess Problem Society), vol. 59, no. 4 (2005), 193-203.

%H R. P. Stanley, <a href="http://www.ams.org/amsmtgs/colloq-10.pdf">Permutations</a>

%H Yidong Sun and Liting Zhai, <a href="https://arxiv.org/1810.07956">Some properties of a class of refined Eulerian polynomials</a>, arXiv:1810.07956 [math.CO], 2018.

%H Zhi-Hong Sun, <a href="http://dx.doi.org/10.1016/j.disc.2007.03.038">Congruences involving Bernoulli polynomials</a>, Discr. Math., 308 (2007), 71-112.

%H Ross Tang, <a href="/A000111/a000111.pdf">An Explicit Formula for the Euler zigzag numbers (Up/down numbers) from power series</a> [From Ross Tang (ph.tchaa(AT)gmail.com), Jul 28 2010. Web page no longer accessible, pdf of archive.org version uploaded by _Ralf Stephan_, Dec 28 2013]

%H S. T. Thompson, <a href="/A260786/a260786.pdf">Problem E754: Skew Ordered Sequences</a>, Amer. Math. Monthly, 54 (1947), 416-417. [Annotated scanned copy]

%H A. Vieru, <a href="http://arxiv.org/abs/1107.2938">Agoh's conjecture: its proof, its generalizations, its analogues</a>, arXiv preprint arXiv:1107.2938 [math.NT], 2011.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/EulerZigzagNumber.html">Euler Zigzag Number</a>.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/AlternatingPermutation.html">Alternating Permutation</a>.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/EntringerNumber.html">Entringer Number</a>.

%H <a href="/index/Cor#core">Index entries for "core" sequences</a>

%H <a href="/index/Bo#boustrophedon">Index entries for sequences related to boustrophedon transform</a>

%F E.g.f.: (1+sin(x))/cos(x) = tan(x) + sec(x).

%F E.g.f. for a(n+1) is 1/(cos(x/2) - sin(x/2))^2 = 1/(1-sin(x)) = d/dx(sec(x) + tan(x)).

%F E.g.f. A(x) = -log(1-sin(x)), for a(n+1). - _Vladimir Kruchinin_, Aug 09 2010

%F O.g.f.: A(x) = 1+x/(1-x-x^2/(1-2*x-3*x^2/(1-3*x-6*x^2/(1-4*x-10*x^2/(1-... -n*x-(n*(n+1)/2)*x^2/(1- ...)))))) (continued fraction). - _Paul D. Hanna_, Jan 17 2006

%F E.g.f. A(x) = y satisfies 2y' = 1 + y^2. - _Michael Somos_, Feb 03 2004

%F a(n) = P_n(0) + Q_n(0) (see A155100 and A104035), defining Q_{-1} = 0. Cf. A156142.

%F 2*a(n+1) = Sum_{k=0..n} binomial(n, k)*a(k)*a(n-k).

%F Asymptotics: a(n) ~ 2^(n+2)*n!/Pi^(n+1). For a proof, see for example Flajolet and Sedgewick.

%F a(n) = (n-1)*a(n-1) - Sum_{i=2..n-2} (i-1)*E(n-2, n-1-i), where E are the Entringer numbers A008281. - _Jon Perry_, Jun 09 2003

%F a(2*k) = (-1)^k euler(2k) and a(2k-1) = (-1)^(k-1)2^(2k)(2^(2k)-1) Bernoulli(2k)/(2k). - C. Ronaldo (aga_new_ac(AT)hotmail.com), Jan 17 2005

%F |a(n+1) - 2*a(n)| = A000708(n). - _Philippe Deléham_, Jan 13 2007

%F a(n) = 2^n|E(n,1/2) + E(n,1)| where E(n,x) are the Euler polynomials. - _Peter Luschny_, Jan 25 2009

%F a(n) = 2^(n+2)*n!*S(n+1)/(Pi)^(n+1), where S(n) = Sum_{k = -inf..inf} 1/(4k+1)^n (see the Elkies reference). - _Emeric Deutsch_, Aug 17 2009

%F a(n) = i^(n+1) Sum_{k=1..n+1} Sum_{j=0..k} binomial(k,j)(-1)^j (k-2j)^(n+1) (2i)^(-k) k^{-1}. - Ross Tang (ph.tchaa(AT)gmail.com), Jul 28 2010

%F a(n) = sum((if evenp(n+k) then (-1)^((n+k)/2)*sum(j!*Stirling2(n,j)*2^(1-j)*(-1)^(n+j-k)*binomial(j-1,k-1),j,k,n) else 0),k,1,n), n>0. - _Vladimir Kruchinin_, Aug 19 2010

%F If n==1(mod 4) is prime, then a(n)==1(mod n); if n==3(mod 4) is prime, then a(n)==-1(mod n). - _Vladimir Shevelev_, Aug 31 2010

%F For m>=0, a(2^m)==1(mod 2^m); If p is prime, then a(2*p)==1(mod 2*p). - _Vladimir Shevelev_, Sep 03 2010

%F From _Peter Bala_, Jan 26 2011: (Start)

%F a(n) = A(n,i)/(1+i)^(n-1), where i = sqrt(-1) and {A(n,x)}n>=1 = [1,1+x,1+4*x+x^2,1+11*x+11*x^2+x^3,...] denotes the sequence of Eulerian polynomials.

%F Equivalently, a(n) = i^(n+1)*Sum_{k=1..n} (-1)^k*k!*Stirling2(n,k) * ((1+i)/2)^(k-1) = i^(n+1)*Sum_{k = 1..n} (-1)^k*((1+i)/2)^(k-1)* Sum_{j = 0..k} (-1)^(k-j)*binomial(k,j)*j^n.

%F This explicit formula for a(n) can be used to obtain congruence results. For example, for odd prime p, a(p) = (-1)^((p-1)/2) (mod p), as noted by _Vladimir Shevelev_ above.

%F For the corresponding type B results see A001586. For the corresponding results for plane increasing 0-1-2 trees see A080635.

%F For generalized Eulerian, Stirling and Bernoulli numbers associated with the zigzag numbers see A145876, A147315 and A185424, respectively. For a recursive triangle to calculate a(n) see A185414.

%F (End)

%F a(n) = I^(n+1)*2*Li_{-n}(-I) for n > 0. Li_{s}(z) is the polylogarithm. - _Peter Luschny_, Jul 29 2011

%F a(n) = 2*Sum_{m=0..(n-2)/2} 4^m*(Sum_{i=m..(n-1)/2} (i-(n-1)/2)^(n-1)*binomial(n-2*m-1,i-m)*(-1)^(n-i-1)), n > 1, a(0)=1, a(1)=1. - _Vladimir Kruchinin_, Aug 09 2011

%F a(n) = D^(n-1)(1/(1-x)) evaluated at x = 0, where D is the operator sqrt(1-x^2)*d/dx. Cf. A006154. a(n) equals the alternating sum of the nonzero elements of row n-1 of A196776. This leads to a combinatorial interpretation for a(n); for example, a(4*n+2) gives the number of ordered set partitions of 4*n+1 into k odd-sized blocks, k = 1 (mod 4), minus the number of ordered set partitions of 4*n+1 into k odd-sized blocks, k = 3 (mod 4). Cf A002017. - _Peter Bala_, Dec 06 2011

%F From _Sergei N. Gladkovskii_, Nov 14 2011 - Dec 23 2013: (Start)

%F Continued fractions:

%F E.g.f.: tan(x) + sec(x) = 1 + x/U(0); U(k) = 4k+1-x/(2-x/(4k+3+x/(2+x/U(k+1)))).

%F E.g.f.: for a(n+1) is E(x) = 1/(1-sin(x)) = 1 + x/(1 - x + x^2/G(0)); G(k) = (2*k+2)*(2*k+3)-x^2+(2*k+2)*(2*k+3)*x^2/G(k+1).

%F E.g.f.: for a(n+1) is E(x) = 1/(1-sin(x)) = 1/(1 - x/(1 + x^2/G(0))) ; G(k) = 8*k+6-x^2/(1 + (2*k+2)*(2*k+3)/G(k+1)).

%F E.g.f.: for a(n+1) is E(x) = 1/(1 - sin(x)) = 1/(1 - x*G(0)); G(k) = 1 - x^2/(2*(2*k+1)*(4*k+3) - 2*x^2*(2*k+1)*(4*k+3)/(x^2 - 4*(k+1)*(4*k+5)/G(k+1))).

%F E.g.f.: for a(n+1) is E(x) = 1/(1 - sin(x)) = 1/(1 - x*G(0)) where G(k)= 1 - x^2/( (2*k+1)*(2*k+3) - (2*k+1)*(2*k+3)^2/(2*k+3 - (2*k+2)/G(k+1))).

%F E.g.f.: tan(x) + sec(x) = 1 + 2*x/(U(0)-x) where U(k) = 4k+2 - x^2/U(k+1).

%F E.g.f.: tan(x) + sec(x) = 1 + 2*x/(2*U(0)-x) where U(k) = 4*k+1 - x^2/(16*k+12 - x^2/U(k+1)).

%F E.g.f.: tan(x) + sec(x) = 4/(2-x*G(0))-1 where G(k) = 1 - x^2/(x^2 - 4*(2*k+1)*(2*k+3)/G(k+1)).

%F G.f.: 1 + x/Q(0), m=+4, u=x/2, where Q(k) = 1 - 2*u*(2*k+1) - m*u^2*(k+1)*(2*k+1)/(1 - 2*u*(2*k+2) - m*u^2*(k+1)*(2*k+3)/Q(k+1)).

%F G.f.: conjecture: 1 + T(0)*x/(1-x), where T(k) = 1 - x^2*(k+1)*(k+2)/(x^2*(k+1)*(k+2) - 2*(1-x*(k+1))*(1-x*(k+2))/T(k+1)).

%F E.g.f.: 1+ 4*x/(T(0) - 2*x), where T(k) = 4*(2*k+1) - 4*x^2/T(k+1):

%F E.g.f.: T(0)-1, where T(k) = 2 + x/(4*k+1 - x/(2 - x/( 4*k+3 + x/T(k+1)))). (End)

%F E.g.f.: tan(x/2 + Pi/4). - _Vaclav Kotesovec_, Nov 08 2013

%F Asymptotic expansion: 4*(2*n/(Pi*e))^(n+1/2)*exp(1/2+1/(12*n) -1/(360*n^3) + 1/(1260*n^5) - ...). (See the Luschny link.) - _Peter Luschny_, Jul 14 2015

%F From _Peter Bala_, Sep 10 2015: (Start)

%F The e.g.f. A(x) = tan(x) + sec(x) satisfies A''(x) = A(x)*A'(x), hence the recurrence a(0) = 1, a(1) = 1, else a(n) = Sum_{i = 0..n-2} binomial(n-2,i)*a(i)*a(n-1-i).

%F Note, the same recurrence, but with the initial conditions a(0) = 0 and a(1) = 1, produces the sequence [0,1,0,1,0,4,0,34,0,496,...], an aerated version of A002105. (End)

%F a(n) = A186365(n)/n for n >= 1. - _Anton Zakharov_, Aug 23 2016

%F From _Peter Luschny_, Oct 27 2017: (Start)

%F a(n) = abs(2*4^n*(H(((-1)^n - 3)/8, -n) - H(((-1)^n - 7)/8, -n))) where H(z, r) are the generalized harmonic numbers.

%F a(n) = (-1)^binomial(n + 1, 2)*2^(2*n + 1)*(zeta(-n, 1 + (1/8)*(-7 + (-1)^n)) - zeta(-n, 1 + (1/8)*(-3 + (-1)^n))). (End)

%F a(n) = i*(i^n*Li_{-n}(-i) - (-i)^n*Li_{-n}(i)), where i is the imaginary unit and Li_{s}(z) is the polylogarithm. - _Peter Luschny_, Aug 28 2020

%F Sum_{n>=0} 1/a(n) = A340315. - _Amiram Eldar_, May 29 2021

%F a(n) = n!*Re([x^n](1 + I^(n^2 - n)*(2 - 2*I)/(exp(x) + I))). - _Peter Luschny_, Aug 09 2021

%e G.f. = 1 + x + x^2 + 2*x^3 + 5*x^4 + 16*x^5 + 61*x^6 + 272*x^7 + 1385*x^8 + ...

%e Sequence starts 1,1,2,5,16,... since possibilities are {}, {A}, {AB}, {ACB, BCA}, {ACBD, ADBC, BCAD, BDAC, CDAB}, {ACBED, ADBEC, ADCEB, AEBDC, AECDB, BCAED, BDAEC, BDCEA, BEADC, BECDA, CDAEB, CDBEA, CEADB, CEBDA, DEACB, DEBCA}, etc. - _Henry Bottomley_, Jan 17 2001

%p A000111 := n-> n!*coeff(series(sec(x)+tan(x),x,n+1), x, n);

%p s := series(sec(x)+tan(x), x, 100): A000111 := n-> n!*coeff(s, x, n);

%p A000111:=n->piecewise(n mod 2=1,(-1)^((n-1)/2)*2^(n+1)*(2^(n+1)-1)*bernoulli(n+1)/(n+1),(-1)^(n/2)*euler(n)):seq(A000111(n),n=0..30); A000111:=proc(n) local k: k:=floor((n+1)/2): if n mod 2=1 then RETURN((-1)^(k-1)*2^(2*k)*(2^(2*k)-1)*bernoulli(2*k)/(2*k)) else RETURN((-1)^k*euler(2*k)) fi: end:seq(A000111(n),n=0..30); (C. Ronaldo)

%p T := n -> 2^n*abs(euler(n,1/2)+euler(n,1)): # _Peter Luschny_, Jan 25 2009

%p S := proc(n,k) option remember; if k=0 then RETURN(`if`(n=0,1,0)) fi; S(n,k-1)+S(n-1,n-k) end:

%p A000364 := n -> S(2*n,2*n);

%p A000182 := n -> S(2*n+1,2*n+1);

%p A000111 := n -> S(n,n); # _Peter Luschny_, Jul 29 2009

%p a := n -> 2^(n+2)*n!*(sum(1/(4*k+1)^(n+1), k = -infinity..infinity))/Pi^(n+1):

%p 1, seq(a(n), n = 1..22); # _Emeric Deutsch_, Aug 17 2009

%p # alternative Maple program:

%p b:= proc(u, o) option remember;

%p `if`(u+o=0, 1, add(b(o-1+j, u-j), j=1..u))

%p end:

%p a:= n-> b(n, 0):

%p seq(a(n), n=0..30); # _Alois P. Heinz_, Nov 29 2015

%t n=22; CoefficientList[Series[(1+Sin[x])/Cos[x], {x, 0, n}], x] * Table[k!, {k, 0, n}] (* _Jean-François Alcover_, May 18 2011, after _Michael Somos_ *)

%t a[n_] := If[EvenQ[n], Abs[EulerE[n]], Abs[(2^(n+1)*(2^(n+1)-1)*BernoulliB[n+1])/(n+1)]]; Table[a[n], {n, 0, 26}] (* _Jean-François Alcover_, Oct 09 2012, after C. Ronaldo *)

%t ee = Table[ 2^n*EulerE[n, 1] + EulerE[n] - 1, {n, 0, 26}]; Table[ Differences[ee, n] // First // Abs, {n, 0, 26}] (* _Jean-François Alcover_, Mar 21 2013, after _Paul Curtz_ *)

%t a[ n_] := If[ n < 0, 0, (2 I)^n If[ EvenQ[n], EulerE[n, 1/2], EulerE[n, 0] I]]; (* _Michael Somos_, Aug 15 2015 *)

%t a[ n_] := If[ n < 1, Boole[n == 0], With[{m = n - 1}, m! SeriesCoefficient[ 1 / (1 - Sin[x]), {x, 0, m}]]]; (* _Michael Somos_, Aug 15 2015 *)

%t s[0] = 1; s[_] = 0; t[n_, 0] := s[n]; t[n_, k_] := t[n, k] = t[n, k-1] + t[n-1, n-k]; a[n_] := t[n, n]; Array[a, 30, 0](* _Jean-François Alcover_, Feb 12 2016 *)

%t a[n_] := If[n == 0, 1, 2*Abs[PolyLog[-n, I]]]; (* _Jean-François Alcover_, Dec 02 2023, after _M. F. Hasler_ *)

%o (PARI) {a(n) = if( n<1, n==0, n--; n! * polcoeff( 1 / (1 - sin(x + x * O(x^n))), n))}; \\ _Michael Somos_, Feb 03 2004

%o (PARI) {a(n) = local(v=[1], t); if( n<0, 0, for(k=2, n+2, t=0; v = vector(k, i, if( i>1, t+= v[k+1-i]))); v[2])}; \\ _Michael Somos_, Feb 03 2004

%o (PARI) {a(n) = local(an); if( n<1, n>=0, an = vector(n+1, m, 1); for( m=2, n, an[m+1] = sum( k=0, m-1, binomial(m-1, k) * an[k+1] * an[m-k]) / 2); an[n+1])}; \\ _Michael Somos_, Feb 03 2004

%o (PARI) z='z+O('z^66); egf = (1+sin(z))/cos(z); Vec(serlaplace(egf)) \\ _Joerg Arndt_, Apr 30 2011

%o (PARI) A000111(n)={my(k);sum(m=0,n\2,(-1)^m*sum(j=0,k=n+1-2*m,binomial(k,j)*(-1)^j*(k-2*j)^(n+1))/k>>k)} \\ _M. F. Hasler_, May 19 2012

%o (PARI) A000111(n)=if(n,2*abs(polylog(-n,I)),1) \\ _M. F. Hasler_, May 20 2012

%o (Maxima) a(n):=sum((if evenp(n+k) then (-1)^((n+k)/2)*sum(j!*stirling2(n,j)*2^(1-j)*(-1)^(n+j-k)*binomial(j-1,k-1),j,k,n) else 0),k,1,n); /* _Vladimir Kruchinin_, Aug 19 2010 */

%o (Maxima)

%o a(n):=if n<2 then 1 else 2*sum(4^m*(sum((i-(n-1)/2)^(n-1)*binomial(n-2*m-1,i-m)*(-1)^(n-i-1),i,m,(n-1)/2)),m,0,(n-2)/2); /* _Vladimir Kruchinin_, Aug 09 2011 */

%o (Sage) # Algorithm of L. Seidel (1877)

%o def A000111_list(n) :

%o R = []; A = {-1:0, 0:1}; k = 0; e = 1

%o for i in (0..n) :

%o Am = 0; A[k + e] = 0; e = -e

%o for j in (0..i) : Am += A[k]; A[k] = Am; k += e

%o R.append(Am)

%o return R

%o A000111_list(22) # _Peter Luschny_, Mar 31 2012 (revised Apr 24 2016)

%o (Haskell)

%o a000111 0 = 1

%o a000111 n = sum $ a008280_row (n - 1)

%o -- _Reinhard Zumkeller_, Nov 01 2013

%o (Python)

%o # requires python 3.2 or higher

%o from itertools import accumulate

%o A000111_list, blist = [1,1], [1]

%o for n in range(10**2):

%o blist = list(reversed(list(accumulate(reversed(blist))))) + [0] if n % 2 else [0]+list(accumulate(blist))

%o A000111_list.append(sum(blist)) # _Chai Wah Wu_, Jan 29 2015

%o (Python)

%o from mpmath import *

%o mp.dps = 150

%o l = chop(taylor(lambda x: sec(x) + tan(x), 0, 26))

%o [int(fac(i) * li) for i, li in enumerate(l)] # _Indranil Ghosh_, Jul 06 2017

%Y Cf. A000364 (secant numbers), A000182 (tangent numbers).

%Y Related triangles: A008280, A008281, A008282, A008970, A010094, A059720, A177762.

%Y Cf. A181937 for n-alternating permutations.

%Y Cf. A109449 for an extension to an exponential Riordan array.

%Y Column k=1 of A010094, A229892, A258829, A262124, A275784.

%Y Column k=2 of A250261.

%Y Cf. A002105, A186365.

%Y For 0-1-2 trees with n nodes and k leaves, see A301344.

%Y Matula-Goebel numbers of 0-1-2 trees are A292050.

%Y An overview over generalized Euler numbers gives A349264.

%Y Cf. A000258, A000311, A002846, A005121, A318813, A320270, A330474, A330665, A330679, A340315.

%K nonn,core,eigen,nice,easy

%O 0,4

%A _N. J. A. Sloane_

%E Edited by _M. F. Hasler_, Apr 04 2013

%E Title corrected by _Geoffrey Critzer_, May 18 2013

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 23 13:41 EDT 2024. Contains 371914 sequences. (Running on oeis4.)