CINXE.COM

A000182 - OEIS

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <html> <head> <link rel="stylesheet" href="/styles.css"> <meta name="format-detection" content="telephone=no"> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta name=viewport content="width=device-width, initial-scale=1"> <meta name="keywords" content="OEIS,integer sequences,Sloane" /> <title>A000182 - OEIS</title> <link rel="search" type="application/opensearchdescription+xml" title="OEIS" href="/oeis.xml"> <script> var myURL = "\/A000182" function redir() { var host = document.location.hostname; if(host != "oeis.org" && host != "127.0.0.1" && !/^([0-9.]+)$/.test(host) && host != "localhost" && host != "localhost.localdomain") { document.location = "https"+":"+"//"+"oeis"+".org/" + myURL; } } function sf() { if(document.location.pathname == "/" && document.f) document.f.q.focus(); } </script> </head> <body bgcolor=#ffffff onload="redir();sf()"> <div class=loginbar> <div class=login> <a href="/login?redirect=%2fA000182">login</a> </div> </div> <div class=center><div class=top> <center> <div class=donors> The OEIS is supported by <a href="http://oeisf.org/#DONATE">the many generous donors to the OEIS Foundation</a>. </div> <div class=banner> <a href="/"><img class=banner border="0" width="600" src="/banner2021.jpg" alt="A000182 - OEIS"></a> </div> </center> </div></div> <div class=center><div class=pagebody> <div class=searchbarcenter> <form name=f action="/search" method="GET"> <div class=searchbargreet> <div class=searchbar> <div class=searchq> <input class=searchbox maxLength=1024 name=q value="" title="Search Query"> </div> <div class=searchsubmit> <input type=submit value="Search" name=go> </div> <div class=hints> <span class=hints><a href="/hints.html">Hints</a></span> </div> </div> <div class=searchgreet> (Greetings from <a href="/welcome">The On-Line Encyclopedia of Integer Sequences</a>!) </div> </div> </form> </div> <div class=sequence> <div class=space1></div> <div class=line></div> <div class=seqhead> <div class=seqnumname> <div class=seqnum> A000182 </div> <div class=seqname> Tangent (or &quot;Zag&quot;) numbers: e.g.f. tan(x), also (up to signs) e.g.f. tanh(x). <br><font size=-1>(Formerly M2096 N0829)</font> </div> </div> <div class=scorerefs> 178 </div> </div> <div> <div class=seqdatabox> <div class=seqdata>1, 2, 16, 272, 7936, 353792, 22368256, 1903757312, 209865342976, 29088885112832, 4951498053124096, 1015423886506852352, 246921480190207983616, 70251601603943959887872, 23119184187809597841473536, 8713962757125169296170811392, 3729407703720529571097509625856</div> <div class=seqdatalinks> (<a href="/A000182/list">list</a>; <a href="/A000182/graph">graph</a>; <a href="/search?q=A000182+-id:A000182">refs</a>; <a href="/A000182/listen">listen</a>; <a href="/history?seq=A000182">history</a>; <a href="/search?q=id:A000182&fmt=text">text</a>; <a href="/A000182/internal">internal format</a>) </div> </div> </div> <div class=entry> <div class=section> <div class=sectname>OFFSET</div> <div class=sectbody> <div class=sectline>1,2</div> </div> </div> <div class=section> <div class=sectname>COMMENTS</div> <div class=sectbody> <div class=sectline>Number of Joyce trees with 2n-1 nodes. Number of tremolo permutations of {0,1,...,2n}. - <a href="/wiki/User:Ralf_Stephan">Ralf Stephan</a>, Mar 28 2003</div> <div class=sectline>The Hankel transform of this sequence is <a href="/A000178" title="Superfactorials: product of first n factorials.">A000178</a>(n) for n odd = 1, 12, 34560, ...; example: det([1, 2, 16; 2, 16, 272, 16, 272, 7936]) = 34560. - <a href="/wiki/User:Philippe_Del茅ham">Philippe Del茅ham</a>, Mar 07 2004</div> <div class=sectline>a(n) is the number of increasing labeled full binary trees with 2n-1 vertices. Full binary means every non-leaf vertex has two children, distinguished as left and right; labeled means the vertices are labeled 1,2,...,2n-1; increasing means every child has a label greater than its parent. - <a href="/wiki/User:David_Callan">David Callan</a>, Nov 29 2007</div> <div class=sectline>From Micha Hofri (hofri(AT)wpi.edu), May 27 2009: (Start)</div> <div class=sectline>a(n) was found to be the number of permutations of [2n] which when inserted in order, to form a binary search tree, yield the maximally full possible tree (with only one single-child node).</div> <div class=sectline>The e.g.f. is sec^2(x)=1+tan^2(x), and the same coefficients can be manufactured from the tan(x) itself, which is the e.g.f. for the number of trees as above for odd number of nodes. (End)</div> <div class=sectline>a(n) is the number of increasing strict binary trees with 2n-1 nodes. For more information about increasing strict binary trees with an associated permutation, see <a href="/A245894" title="Number of labeled increasing binary trees on 2n-1 nodes whose breadth-first reading word avoids 231.">A245894</a>. - <a href="/wiki/User:Manda_Riehl">Manda Riehl</a>, Aug 07 2014</div> <div class=sectline>For relations to alternating permutations, Euler and Bernoulli polynomials, zigzag numbers, trigonometric functions, Fourier transform of a square wave, quantum algebras, and integrals over and in n-dimensional hypercubes and over Green functions, see Hodges and Sukumar. For further discussion on the quantum algebra, see the later Hodges and Sukumar reference and the paper by Hetyei presenting connections to the general combinatorial theory of Viennot on orthogonal polynomials, inverse polynomials, tridiagonal matrices, and lattice paths (thereby related to continued fractions and cumulants). - <a href="/wiki/User:Tom_Copeland">Tom Copeland</a>, Nov 30 2014</div> <div class=sectline>The Zigzag Hankel transform is <a href="/A000178" title="Superfactorials: product of first n factorials.">A000178</a>. That is, <a href="/A000178" title="Superfactorials: product of first n factorials.">A000178</a>(2*n - k) = det( [a(i+j - k)]_{i,j = 1..n} ) for n&gt;0 and k=0,1. - <a href="/wiki/User:Michael_Somos">Michael Somos</a>, Mar 12 2015</div> <div class=sectline>a(n) is the number of standard Young tableaux of skew shape (n,n,n-1,n-2,...,3,2)/(n-1,n-2,n-3,...,2,1). - <a href="/wiki/User:Ran_Pan">Ran Pan</a>, Apr 10 2015</div> <div class=sectline>For relations to the Sheffer Appell operator calculus and a Riccati differential equation for generating the Meixner-Pollaczek and Krawtchouk orthogonal polynomials, see page 45 of the Feinsilver link and Rzadkowski. - <a href="/wiki/User:Tom_Copeland">Tom Copeland</a>, Sep 28 2015</div> <div class=sectline>For relations to an elliptic curve, a Weierstrass elliptic function, the Lorentz formal group law, a Lie infinitesimal generator, and the Eulerian numbers <a href="/A008292" title="Triangle of Eulerian numbers T(n,k) (n &gt;= 1, 1 &lt;= k &lt;= n) read by rows.">A008292</a>, see <a href="/A155585" title="a(n) = 2^n*E(n, 1) where E(n, x) are the Euler polynomials.">A155585</a>. - <a href="/wiki/User:Tom_Copeland">Tom Copeland</a>, Sep 30 2015</div> <div class=sectline>Absolute values of the alternating sums of the odd-numbered rows (where the single 1 at the apex of the triangle is counted as row #1) of the Eulerian triangle, <a href="/A008292" title="Triangle of Eulerian numbers T(n,k) (n &gt;= 1, 1 &lt;= k &lt;= n) read by rows.">A008292</a>. The actual alternating sums alternate in sign, e.g., 1, -2, 16, -272, etc. (Even-numbered rows have alternating sums always 0.) - <a href="/wiki/User:Gregory_Gerard_Wojnar">Gregory Gerard Wojnar</a>, Sep 28 2018</div> <div class=sectline>The sequence is periodic modulo any odd prime p. The minimal period is (p-1)/2 if p == 1 mod 4 and p-1 if p == 3 mod 4 [Knuth &amp; Buckholtz, 1967, Theorem 1]. - <a href="/wiki/User:Allen_Stenger">Allen Stenger</a>, Aug 03 2020</div> <div class=sectline>From <a href="/wiki/User:Peter_Bala">Peter Bala</a>, Dec 24 2021: (Start)</div> <div class=sectline>Conjectures:</div> <div class=sectline>1) The sequence taken modulo any integer k eventually becomes periodic with period dividing phi(k).</div> <div class=sectline>2) The Gauss congruences a(n*p^k) == a(n*p^(k-1)) ( mod p^k ) hold for all prime p and positive integers n and k, except when p = 2, n = 1 and k = 1 or 2.</div> <div class=sectline>3) For i &gt;= 1 define a_i(n) = a(n+i). The Gauss congruences a_i(n*p^k) == a_i(n*p^(k-1)) ( mod p^k ) hold for all prime p and positive integers n and k. If true, then for each i &gt;= 1 the expansion of exp(Sum_{n &gt;= 1} a_i(n)*x^n/n) has integer coefficients. For an example, see <a href="/A262145" title="O.g.f.: exp( Sum_{n &gt;= 1} A000182(n+1)*x^n/n ), where A000182 is the sequence of tangent numbers.">A262145</a>.(End)</div> </div> </div> <div class=section> <div class=sectname>REFERENCES</div> <div class=sectbody> <div class=sectline>Miklos Bona, editor, Handbook of Enumerative Combinatorics, CRC Press, 2015, page 932.</div> <div class=sectline>L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 88.</div> <div class=sectline>H. Doerrie, 100 Great Problems of Elementary Mathematics, Dover, NY, 1965, p. 69.</div> <div class=sectline>L. M. Milne-Thompson, Calculus of Finite Differences, 1951, p. 148 (the numbers |C^{2n-1}|).</div> <div class=sectline>J. W. Milnor and J. D. Stasheff, Characteristic Classes, Princeton, 1974, p. 282.</div> <div class=sectline>S. Mukai, An Introduction to Invariants and Moduli, Cambridge, 2003; see p. 444.</div> <div class=sectline>H. Rademacher, Topics in Analytic Number Theory, Springer, 1973, Chap. 1, p. 20.</div> <div class=sectline>L. Seidel, 脺ber eine einfache Entstehungsweise der Bernoullischen Zahlen und einiger verwandten Reihen, Sitzungsberichte der mathematisch-physikalischen Classe der k枚niglich bayerischen Akademie der Wissenschaften zu M眉nchen, volume 7 (1877), 157-187.</div> <div class=sectline>N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).</div> <div class=sectline>N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).</div> <div class=sectline>Ross Street, Surprising relationships connecting ploughing a field, mathematical trees, permutations, and trigonometry, Slides from a talk, July 15 2015, Macquarie University. [&quot;There is a Web Page oeis.org by N. J. A. Sloane. It tells, from typing the first few terms of a sequence, whether that sequence has occurred somewhere else in Mathematics. Postgraduate student Daniel Steffen traced this down and found, to our surprise, that the sequence was related to the tangent function tan x. Ryan and Tam searched out what was known about this connection and discovered some apparently new results. We all found this a lot of fun and I hope you will too.&quot;]</div> <div class=sectline>E. van Fossen Conrad, Some continued fraction expansions of elliptic functions, PhD thesis, The Ohio State University, 2002, p. 28.</div> <div class=sectline>J. V. Uspensky and M. A. Heaslet, Elementary Number Theory, McGraw-Hill, NY, 1939, pp. 267-268.</div> </div> </div> <div class=section> <div class=sectname>LINKS</div> <div class=sectbody> <div class=sectline>Seiichi Manyama, <a href="/A000182/b000182.txt">Table of n, a(n) for n = 1..243</a> (terms 1..100 from N. J. A. Sloane)</div> <div class=sectline>V. E. Adler and A. B. Shabat, <a href="https://arxiv.org/abs/1810.13198">Volterra chain and Catalan numbers</a>, arXiv:1810.13198 [nlin.SI], 2018.</div> <div class=sectline>J. L. Arregui, <a href="https://arxiv.org/abs/math/0109108">Tangent and Bernoulli numbers related to Motzkin and Catalan numbers by means of numerical triangles</a>, arXiv:math/0109108 [math.NT], 2001.</div> <div class=sectline>脡tienne Bellin, Arthur Blanc-Renaudie, Emmanuel Kammerer, and Igor Kortchemski, <a href="https://arxiv.org/abs/2308.00493">Uniform attachment with freezing</a>, arXiv:2308.00493 [math.PR], 2023. See p. 13.</div> <div class=sectline>Be谩ta B茅nyi, Miguel M茅ndez, Jos茅 L. Ram铆rez, and Tanay Wakhare, <a href="https://arxiv.org/abs/1811.12897">Restricted r-Stirling Numbers and their Combinatorial Applications</a>, arXiv:1811.12897 [math.CO], 2018.</div> <div class=sectline>Richard P. Brent and David Harvey, <a href="http://arxiv.org/abs/1108.0286">Fast computation of Bernoulli, Tangent and Secant numbers</a>, arXiv preprint arXiv:1108.0286 [math.CO], 2011.</div> <div class=sectline>F. C. S. Brown, T. M. A. Fink and K. Willbrand, <a href="https://arxiv.org/abs/math/0607763">On arithmetic and asymptotic properties of up-down numbers</a>, arXiv:math/0607763 [math.CO], 2006.</div> <div class=sectline>K.-W. Chen, <a href="http://www.cs.uwaterloo.ca/journals/JIS/VOL4/CHEN/AlgBE2.html">Algorithms for Bernoulli numbers and Euler numbers</a>, J. Integer Sequences, 4 (2001), #01.1.6.</div> <div class=sectline>Bishal Deb and Alan D. Sokal, <a href="https://arxiv.org/abs/2212.07232">Classical continued fractions for some multivariate polynomials generalizing the Genocchi and median Genocchi numbers</a>, arXiv:2212.07232 [math.CO], 2022. See p. 11.</div> <div class=sectline>D. Dumont, <a href="http://dx.doi.org/10.1215/S0012-7094-74-04134-9">Interpr茅tations combinatoires des nombres de Genocchi</a>, Duke Math. J., 41 (1974), 305-318.</div> <div class=sectline>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.</div> <div class=sectline>A. L. Edmonds and S. Klee, <a href="http://arxiv.org/abs/1210.7396">The combinatorics of hyperbolized manifolds</a>, arXiv preprint arXiv:1210.7396 [math.CO], 2012. - From <a href="/wiki/User:N._J._A._Sloane">N. J. A. Sloane</a>, Jan 02 2013</div> <div class=sectline>P. Feinsilver, <a href="http://chanoir.math.siu.edu/MATH/Merida/PDF/Merida.pdf">Lie algebras, representations, and analytic semigroups through dual vector fields</a></div> <div class=sectline>C. J. Fewster and D. Siemssen, <a href="http://arxiv.org/abs/1403.1723">Enumerating Permutations by their Run Structure</a>, arXiv preprint arXiv:1403.1723 [math.CO], 2014.</div> <div class=sectline>P. Flajolet and R. Sedgewick, <a href="http://algo.inria.fr/flajolet/Publications/books.html">Analytic Combinatorics</a>, 2009; see page 144.</div> <div class=sectline>Dominique Foata and Guo-Niu Han, <a href="http://dx.doi.org/10.1093/qmath/hap043">Doubloons and new q-tangent numbers</a>, Quart. J. Math. 62 (2) (2011) 417-432.</div> <div class=sectline>D. Foata and G.-N. Han, <a href="http://www-irma.u-strasbg.fr/~foata/paper/pub120.html">Tree Calculus for Bivariable Difference Equations</a>, 2012. - From <a href="/wiki/User:N._J._A._Sloane">N. J. A. Sloane</a>, Feb 02 2013</div> <div class=sectline>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.</div> <div class=sectline>Ghislain R. Franssens, <a href="http://www.cs.uwaterloo.ca/journals/JIS/VOL9/Franssens/franssens13.html">On a Number Pyramid Related to the Binomial, Deleham, Eulerian, MacMahon and Stirling number triangles</a>, Journal of Integer Sequences, Vol. 9 (2006), Article 06.4.1.</div> <div class=sectline>M.-P. Grosset and A. P. Veselov, <a href="https://arxiv.org/abs/math/0503175">Bernoulli numbers and solitons</a>, arXiv:math/0503175 [math.GM], 2005.</div> <div class=sectline>Christian G眉nther and Kai-Uwe Schmidt, <a href="http://arxiv.org/abs/1602.01750">L^q norms of Fekete and related polynomials</a>, arXiv:1602.01750 [math.NT], 2016.</div> <div class=sectline>Guo-Niu Han and Jing-Yi Liu, <a href="https://doi.org/10.1016/j.ejc.2018.02.041">Combinatorial proofs of some properties of tangent and Genocchi numbers</a>, European Journal of Combinatorics, Vol. 71 (2018), pp. 99-110; <a href="https://arxiv.org/abs/1707.08882">arXiv preprint</a>, arXiv:1707.08882 [math.CO], 2017-2018.</div> <div class=sectline>Yanjun Han and Jonathan Niles-Weed, <a href="https://arxiv.org/abs/2408.09341">Approximate independence of permutation mixtures</a>, arXiv:2408.09341 [math.ST], 2024. See p. 12.</div> <div class=sectline>G. Hetyei, <a href="http://arxiv.org/abs/0909.4352">Meixner polynomials of the second kind and quantum algebras representing su(1,1)</a>, arXiv preprint arXiv:0909.4352 [math.QA], 2009.</div> <div class=sectline>A. Hodges and C. Sukumar, <a href="https://doi.org/10.1098/rspa.2007.0001">Bernoulli, Euler, permutations and quantum algebras</a>, Proc. Royal Soc. A (2007) 463, 2401-2414.</div> <div class=sectline>A. Hodges and C. Sukumar, <a href="https://doi.org/10.1098/rspa.2007.0003">Quantum algebras and parity-dependent spectra</a>, Proc. Royal Soc. A (2007) 463, 2415-2427.</div> <div class=sectline>Hsien-Kuei Hwang and Emma Yu Jin, <a href="https://arxiv.org/abs/1911.06690">Asymptotics and statistics on Fishburn matrices and their generalizations</a>, arXiv:1911.06690 [math.CO], 2019.</div> <div class=sectline>Svante Janson, <a href="http://arxiv.org/abs/1305.3512">Euler-Frobenius numbers and rounding</a>, arXiv preprint arXiv:1305.3512 [math.PR], 2013</div> <div class=sectline>Donald E. Knuth and Thomas J. Buckholtz, <a href="http://dx.doi.org/10.1090/S0025-5718-1967-0221735-9">Computation of tangent, Euler and Bernoulli numbers</a>, Math. Comp. 21 1967 663-688.</div> <div class=sectline>D. E. Knuth and Thomas J.Buckholtz, <a href="/A000182/a000182.pdf"> Computation of tangent, Euler and Bernoulli numbers</a>, Math. Comp. 21 1967 663-688. [Annotated scanned copy]</div> <div class=sectline>A. R. Kr盲uter, <a href="http://www.mat.univie.ac.at/~slc/opapers/s09kraeu.html">Permanenten - Ein kurzer 脺berblick</a>, S茅minaire Lotharingien de Combinatoire, B09b (1983), 34 pp.</div> <div class=sectline>A. R. Kr盲uter, <a href="http://www.mat.univie.ac.at/~slc/opapers/s11kraeu.html">脺ber die Permanente gewisser zirkul盲rer Matrizen...</a>, S茅minaire Lotharingien de Combinatoire, B11b (1984), 11 pp.</div> <div class=sectline>Johann Heinrich Lambert, <a href="http://bibliothek.bbaw.de/bibliothek-digital/digitalequellen/schriften/anzeige/index_html?band=02-hist/1761&amp;seite:int=282">M茅moire sur quelques propri茅t茅s remarquables des quantit茅s transcendentes circulaires et logarithmiques</a>, Histoire de l'Acad茅mie Royale des Sciences et des Belles-Lettres de Berlin 1761 (Berlin: Haude et Spener, 1768) pp. 265-322.</div> <div class=sectline>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.</div> <div class=sectline>Peter Luschny, <a href="http://www.luschny.de/math/primes/eulerinc.html">Approximation, inclusion and asymptotics of the Euler numbers</a></div> <div class=sectline>Dragan Ma拧ulovi膰, <a href="https://arxiv.org/abs/1912.03022">Big Ramsey spectra of countable chains</a>, arXiv:1912.03022 [math.CO], 2019.</div> <div class=sectline>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.</div> <div class=sectline>N. E. N酶rlund, <a href="http://www-gdz.sub.uni-goettingen.de/cgi-bin/digbib.cgi?PPN373206070">Vorlesungen ueber Differenzenrechnung</a> Springer 1924, p. 27.</div> <div class=sectline>N. E. N枚rlund, <a href="/A001896/a001896_1.pdf">Vorlesungen 眉ber Differenzenrechnung</a>, Springer-Verlag, Berlin, 1924 [Annotated scanned copy of pages 144-151 and 456-463]</div> <div class=sectline>Jay Rosen, <a href="http://dx.doi.org/10.1016/0097-3165(76)90035-2">The Number of Product-Weighted Lead Codes for Ballots and Its Relation to the Ursell Functions of the Linear Ising Model</a>, Journal of Combinatorial Theory, Vol. 20, No.3, May 1976, 377-384.</div> <div class=sectline>G. Rzadkowski, <a href="http://dx.doi.org/10.1142/S1402925110000635">Bernoulli numbers and solitons-revisited</a>, Jrn. Nonlinear Math. Physics, 1711, pp. 121-126. (Added by Tom Copeland, Sep 29 2015)</div> <div class=sectline>Raphael Schumacher, <a href="http://arxiv.org/abs/1602.00336">Rapidly Convergent Summation Formulas involving Stirling Series</a>, arXiv preprint arXiv:1602.00336 [math.NT], 2016.</div> <div class=sectline>D. Shanks, <a href="http://dx.doi.org/10.1090/S0025-5718-1967-0223295-5">Generalized Euler and class numbers</a>, Math. Comp. 21 (1967) 689-694.</div> <div class=sectline>D. Shanks, <a href="http://dx.doi.org/10.1090/S0025-5718-68-99652-X">Corrigendum: Generalized Euler and class numbers</a>. Math. Comp. 22, (1968) 699.</div> <div class=sectline>D. Shanks, <a href="/A000003/a000003.pdf">Generalized Euler and class numbers</a>, Math. Comp. 21 (1967), 689-694; 22 (1968), 699. [Annotated scanned copy]</div> <div class=sectline>Vladimir Shevelev, <a href="http://www.emis.de/journals/INTEGERS/papers/m1/m1.Abstract.html">The number of permutations with prescribed up-down structure as a function of two variables</a>, INTEGERS, 12 (2012), #A1. - From <a href="/wiki/User:N._J._A._Sloane">N. J. A. Sloane</a>, Feb 07 2013</div> <div class=sectline>N. J. A. Sloane, <a href="/A001469/a001469_1.pdf">Rough notes on Genocchi numbers</a></div> <div class=sectline>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).</div> <div class=sectline>R. P. Stanley, <a href="http://www.ams.org/amsmtgs/colloq-10.pdf">Permutations</a></div> <div class=sectline>Ross Street, <a href="http://arxiv.org/abs/math/0303267">Trees, permutations and the tangent function</a> gives definition of Joyce trees and tremolo permutations, arXiv:math/0303267 [math.HO], 2003.</div> <div class=sectline>Zhi-Wei Sun, <a href="http://math.nju.edu.cn/~zwsun/142p.pdf">Conjectures involving arithmetical sequences</a>, Number Theory: Arithmetic in Shangri-La (eds., S. Kanemitsu, H.-Z. Li and J.-Y. Liu), Proc. the 6th China-Japan Sem. Number Theory (Shanghai, August 15-17, 2011), World Sci., Singapore, 2013, pp. 244-258. - <a href="/wiki/User:N._J._A._Sloane">N. J. A. Sloane</a>, Dec 28 2012</div> <div class=sectline>Zhi-Wei Sun, <a href="http://arxiv.org/abs/1208.2683">Conjectures involving combinatorial sequences</a>, arXiv preprint arXiv:1208.2683 [math.CO], 2012. - From N. J. A. Sloane, Dec 25 2012</div> <div class=sectline>M. S. Tokmachev, <a href="https://vestnik.susu.ru/mmph/article/viewFile/8337/6806">Correlations Between Elements and Sequences in a Numerical Prism</a>, Bulletin of the South Ural State University, Ser. Mathematics. Mechanics. Physics, 2019, Vol. 11, No. 1, 24-33.</div> <div class=sectline>Yi Wang and Bao-Xuan Zhu, <a href="http://arxiv.org/abs/1303.5595">Proofs of some conjectures on monotonicity of number-theoretic and combinatorial sequences</a>, arXiv preprint arXiv:1303.5595 [math.CO], 2013.</div> <div class=sectline>Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/TangentNumber.html">Tangent Number</a></div> <div class=sectline>Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/AlternatingPermutation.html">Alternating Permutation</a></div> <div class=sectline>Philip B. Zhang, <a href="http://arxiv.org/abs/1408.4235">On the Real-rootedness of the Descent Polynomials of (n-2)-Stack Sortable Permutations</a>, arXiv preprint arXiv:1408.4235 [math.CO], 2014.</div> <div class=sectline>Bao-Xuan Zhu, <a href="http://arxiv.org/abs/1309.5693">Analytic approaches to monotonicity and log-behavior of combinatorial sequences</a>, arXiv preprint arXiv:1309.5693 [math.CO], 2013.</div> <div class=sectline><a href="/index/Cor#core">Index entries for &quot;core&quot; sequences</a></div> <div class=sectline><a href="/index/Bo#boustrophedon">Index entries for sequences related to boustrophedon transform</a></div> <div class=sectline><a href="/index/Be#Bernoulli">Index entries for sequences related to Bernoulli numbers.</a></div> </div> </div> <div class=section> <div class=sectname>FORMULA</div> <div class=sectbody> <div class=sectline>E.g.f.: log(sec x) = Sum_{n &gt; 0} a(n)*x^(2*n)/(2*n)!.</div> <div class=sectline>E.g.f.: tan x = Sum_{n &gt;= 0} a(n+1)*x^(2*n+1)/(2*n+1)!.</div> <div class=sectline>E.g.f.: (sec x)^2 = Sum_{n &gt;= 0} a(n+1)*x^(2*n)/(2*n)!.</div> <div class=sectline>2/(exp(2x)+1) = 1 + Sum_{n&gt;=1} (-1)^(n+1) a(n) x^(2n-1)/(2n-1)! = 1 - x + x^3/3 - 2*x^5/15 + 17*x^7/315 - 62*x^9/2835 + ...</div> <div class=sectline>a(n) = 2^(2*n) (2^(2*n) - 1) |B_(2*n)| / (2*n) where B_n are the Bernoulli numbers (<a href="/A000367" title="Numerators of Bernoulli numbers B_2n.">A000367</a>/<a href="/A002445" title="Denominators of Bernoulli numbers B_{2n}.">A002445</a> or <a href="/A027641" title="Numerator of Bernoulli number B_n.">A027641</a>/<a href="/A027642" title="Denominator of Bernoulli number B_n.">A027642</a>).</div> <div class=sectline>Asymptotics: a(n) ~ 2^(2*n+1)*(2*n-1)!/Pi^(2*n).</div> <div class=sectline>Sum[2^(2*n + 1 - k)*(-1)^(n + k + 1)*k!*StirlingS2[2*n + 1, k], {k, 1, 2*n + 1}]. - Victor Adamchik, Oct 05 2005</div> <div class=sectline>a(n) = abs[c(2*n-1)] where c(n)= 2^(n+1) * (1-2^(n+1)) * Ber(n+1)/(n+1) = 2^(n+1) * (1-2^(n+1)) * (-1)^n * Zeta(-n) = [ -(1+EN(.))]^n = 2^n * GN(n+1)/(n+1) = 2^n * EP(n,0) = (-1)^n * E(n,-1) = (-2)^n * n! * Lag[n,-P(.,-1)/2] umbrally = (-2)^n * n! * C{T[.,P(.,-1)/2] + n, n} umbrally for the signed Euler numbers EN(n), the Bernoulli numbers Ber(n), the Genocchi numbers GN(n), the Euler polynomials EP(n,t), the Eulerian polynomials E(n,t), the Touchard / Bell polynomials T(n,t), the binomial function C(x,y) = x!/[(x-y)!*y! ] and the polynomials P(j,t) of <a href="/A131758" title="Coefficients of numerators of rational functions whose binomial transforms give the normalized polylogarithms Li(-n,t)/n!.">A131758</a>. - <a href="/wiki/User:Tom_Copeland">Tom Copeland</a>, Oct 05 2007</div> <div class=sectline>a(1) = <a href="/A094665" title="Another version of triangular array in A083061: triangle T(n,k), 0&lt;=k&lt;=n, read by rows; given by [0, 1, 3, 6, 10, 15, 21, 28...">A094665</a>(0,0)*<a href="/A156919" title="Table of coefficients of polynomials related to the Dirichlet eta function.">A156919</a>(0,0) and a(n) = Sum_{k=1..n-1} 2^(n-k-1)*<a href="/A094665" title="Another version of triangular array in A083061: triangle T(n,k), 0&lt;=k&lt;=n, read by rows; given by [0, 1, 3, 6, 10, 15, 21, 28...">A094665</a>(n-1, k)*<a href="/A156919" title="Table of coefficients of polynomials related to the Dirichlet eta function.">A156919</a>(k,0) for n = 2, 3, .., see <a href="/A162005" title="The EG1 triangle.">A162005</a>. - <a href="/wiki/User:Johannes_W._Meijer">Johannes W. Meijer</a>, Jun 27 2009</div> <div class=sectline>G.f.: 1/(1-1*2*x/(1-2*3*x/(1-3*4*x/(1-4*5*x/(1-5*6*x/(1-... (continued fraction). - <a href="/wiki/User:Paul_Barry">Paul Barry</a>, Feb 24 2010</div> <div class=sectline>From <a href="/wiki/User:Paul_Barry">Paul Barry</a>, Mar 29 2010: (Start)</div> <div class=sectline>G.f.: 1/(1-2x-12x^2/(1-18x-240x^2/(1-50x-1260x^2/(1-98x-4032x^2/(1-162x-9900x^2/(1-... (continued fraction);</div> <div class=sectline>coefficient sequences given by 4*(n+1)^2*(2n+1)*(2n+3) and 2(2n+1)^2 (see Van Fossen Conrad reference). (End)</div> <div class=sectline>E.g.f.: x*Sum_{n&gt;=0} Product_{k=1..n} tanh(2*k*x) = Sum_{n&gt;=1} a(n)*x^n/(n-1)!. - <a href="/wiki/User:Paul_D._Hanna">Paul D. Hanna</a>, May 11 2010 [corrected by <a href="/wiki/User:Paul_D._Hanna">Paul D. Hanna</a>, Sep 28 2023]</div> <div class=sectline>a(n) = (-1)^(n+1)*Sum_{j=1..2*n+1} j!*Stirling2(2*n+1,j)*2^(2*n+1-j)*(-1)^j for n &gt;= 0. <a href="/wiki/User:Vladimir_Kruchinin">Vladimir Kruchinin</a>, Aug 23 2010: (Start)</div> <div class=sectline>If n is odd such that 2*n-1 is prime, then a(n) == 1 (mod (2*n-1)); if n is even such that 2*n-1 is prime, then a(n) == -1 (mod (2*n-1)). - <a href="/wiki/User:Vladimir_Shevelev">Vladimir Shevelev</a>, Sep 01 2010</div> <div class=sectline>Recursion: a(n) = (-1)^(n-1) + Sum_{i=1..n-1} (-1)^(n-i+1)*C(2*n-1,2*i-1)* a(i). - <a href="/wiki/User:Vladimir_Shevelev">Vladimir Shevelev</a>, Aug 08 2011</div> <div class=sectline>E.g.f.: tan(x) = Sum_{n&gt;=1} a(n)*x^(2*n-1)/(2*n-1)! = x/(1 - x^2/(3 - x^2/(5 - x^2/(7 - x^2/(9 - x^2/(11 - x^2/(13 -...))))))) (continued fraction from J. H. Lambert - 1761). - <a href="/wiki/User:Paul_D._Hanna">Paul D. Hanna</a>, Sep 21 2011</div> <div class=sectline>From <a href="/wiki/User:Sergei_N._Gladkovskii">Sergei N. Gladkovskii</a>, Oct 31 2011 to Oct 09 2013: (Start)</div> <div class=sectline>Continued fractions:</div> <div class=sectline>E.g.f.: (sec(x))^2 = 1+x^2/(x^2+U(0)) where U(k) = (k+1)*(2k+1) - 2x^2 + 2x^2*(k+1)*(2k+1)/U(k+1).</div> <div class=sectline>E.g.f.: tan(x) = x*T(0) where T(k) = 1-x^2/(x^2-(2k+1)*(2k+3)/T(k+1)).</div> <div class=sectline>E.g.f.: tan(x) = x/(G(0)+x) where G(k) = 2*k+1 - 2*x + x/(1 + x/G(k+1)).</div> <div class=sectline>E.g.f.: tanh(x) = x/(G(0)-x) where G(k) = k+1 + 2*x - 2*x*(k+1)/G(k+1).</div> <div class=sectline>E.g.f.: tan(x) = 2*x - x/W(0) where W(k) = 1 + x^2*(4*k+5)/((4*k+1)*(4*k+3)*(4*k+5) - 4*x^2*(4*k+3) + x^2*(4*k+1)/W(k+1)).</div> <div class=sectline>E.g.f.: tan(x) = x/T(0) where T(k) = 1 - 4*k^2 + x^2*(1 - 4*k^2)/T(k+1).</div> <div class=sectline>E.g.f.: tan(x) = -3*x/(T(0)+3*x^2) where T(k)= 64*k^3 + 48*k^2 - 4*k*(2*x^2 + 1) - 2*x^2 - 3 - x^4*(4*k -1)*(4*k+7)/T(k+1).</div> <div class=sectline>G.f.: 1/G(0) where G(k) = 1 - 2*x*(2*k+1)^2 - x^2*(2*k+1)*(2*k+2)^2*(2*k+3)/G(k+1).</div> <div class=sectline>G.f.: 2*Q(0) - 1 where Q(k) = 1 + x^2*(4*k + 1)^2/(x + x^2*(4*k + 1)^2 - x^2*(4*k + 3)^2*(x + x^2*(4*k + 1)^2)/(x^2*(4*k + 3)^2 + (x + x^2*(4*k + 3)^2)/Q(k+1) )).</div> <div class=sectline>G.f.: (1 - 1/G(0))*sqrt(-x), where G(k) = 1 + sqrt(-x) - x*(k+1)^2/G(k+1).</div> <div class=sectline>G.f.: Q(0), where Q(k) = 1 - x*(k+1)*(k+2)/( x*(k+1)*(k+2) - 1/Q(k+1)). (End)</div> <div class=sectline>O.g.f.: x + 2*x*Sum_{n&gt;=1} x^n * Product_{k=1..n} (2*k-1)^2 / (1 + (2*k-1)^2*x). - Paul D. Hanna, Feb 05 2013</div> <div class=sectline>a(n) = (-4)^n*Li_{1-2*n}(-1). - Peter Luschny, Jun 28 2012</div> <div class=sectline>a(n) = (-4)^n*(4^n-1)*Zeta(1-2*n). - <a href="/wiki/User:Jean-Fran莽ois_Alcover">Jean-Fran莽ois Alcover</a>, Dec 05 2013</div> <div class=sectline>Asymptotic expansion: 4*((2*(2*n-1))/(Pi*e))^(2*n-1/2)*exp(1/2+1/(12*(2*n-1))-1/(360*(2*n-1)^3)+1/(1260*(2*n-1)^5)-...). (See Luschny link.) - <a href="/wiki/User:Peter_Luschny">Peter Luschny</a>, Jul 14 2015</div> <div class=sectline>From <a href="/wiki/User:Peter_Bala">Peter Bala</a>, Sep 11 2015: (Start)</div> <div class=sectline>The e.g.f. A(x) = tan(x) satisfies the differential equation A''(x) = 2*A(x)*A'(x) with A(0) = 0 and A'(0) = 1, leading to the recurrence a(0) = 0, a(1) = 1, else a(n) = 2*Sum_{i = 0..n-2} binomial(n-2,i)*a(i)*a(n-1-i) for the aerated sequence [0, 1, 0, 2, 0, 16, 0, 272, ...].</div> <div class=sectline>Note, the same recurrence, but with the initial conditions a(0) = 1 and a(1) = 1, produces the sequence n! and with a(0) = 1/2 and a(1) = 1 produces <a href="/A080635" title="Number of permutations on n letters without double falls and without initial falls.">A080635</a>. Cf. <a href="/A002105" title="Reduced tangent numbers: 2^n*(2^{2n} - 1)*|B_{2n}|/n, where B_n = Bernoulli numbers.">A002105</a>, <a href="/A234797" title="E.g.f. satisfies: A'(x) = 1 + A(x) + 2*A(x)^2, where A(0)=0.">A234797</a>. (End)</div> <div class=sectline>a(n) = 2*polygamma(2*n-1, 1/2)/Pi^(2*n). - <a href="/wiki/User:Vladimir_Reshetnikov">Vladimir Reshetnikov</a>, Oct 18 2015</div> <div class=sectline>a(n) = 2^(2n-2)*|p(2n-1,-1/2)|, where p_n(x) are the shifted row polynomials of <a href="/A019538" title="Triangle of numbers T(n,k) = k!*Stirling2(n,k) read by rows (n &gt;= 1, 1 &lt;= k &lt;= n).">A019538</a>. E.g., a(2) = 2 = 2^2 * |1 + 6(-1/2) + 6(-1/2)^2|. - <a href="/wiki/User:Tom_Copeland">Tom Copeland</a>, Oct 19 2016</div> <div class=sectline>From <a href="/wiki/User:Peter_Bala">Peter Bala</a>, May 05 2017: (Start)</div> <div class=sectline>With offset 0, the o.g.f. A(x) = 1 + 2*x + 16*x^2 + 272*x^3 + ... has the property that its 4th binomial transform 1/(1 - 4*x) A(x/(1 - 4*x)) has the S-fraction representation 1/(1 - 6*x/(1 - 2*x/(1 - 20*x/(1 - 12*x/(1 - 42*x/(1 - 30*x/(1 - ...))))))), where the coefficients [6, 2, 20, 12, 42, 30, ...] in the partial numerators of the continued fraction are obtained from the sequence [2, 6, 12, 20, ..., n*(n + 1), ...] by swapping adjacent terms. Compare with the S-fraction associated with A(x) given above by Paul Barry.</div> <div class=sectline>A(x) = 1/(1 + x - 3*x/(1 - 4*x/(1 + x - 15*x/(1 - 16*x/(1 + x - 35*x/(1 - 36*x/(1 + x - ...))))))), where the unsigned coefficients in the partial numerators [3, 4, 15, 16, 35, 36,...] come in pairs of the form 4*n^2 - 1, 4*n^2 for n = 1,2,.... (End)</div> <div class=sectline>a(n) = Sum_{k = 1..n-1} binomial(2*n-2, 2*k-1) * a(k) * a(n-k), with a(1) = 1. - <a href="/wiki/User:Michael_Somos">Michael Somos</a>, Aug 02 2018</div> <div class=sectline>a(n) = 2^(2*n-1) * |Euler(2*n-1, 0)|, where Euler(n,x) are the Euler polynomials. - <a href="/wiki/User:Daniel_Suteu">Daniel Suteu</a>, Nov 21 2018 (restatement of one of Copeland's 2007 formulas.)</div> <div class=sectline>x - Sum_{n &gt;= 1} (-1)^n*a(n)*x^(2*n)/(2*n)! = x - log(cosh(x)). The series reversion of x - log(cosh(x)) is (1/2)*x - (1/2)*log(2 - exp(x)) = Sum_{n &gt;= 0} <a href="/A000670" title="Fubini numbers: number of preferential arrangements of n labeled elements; or number of weak orders on n labeled elements; o...">A000670</a>(n)*x^(n+1)/(n+1)!. - <a href="/wiki/User:Peter_Bala">Peter Bala</a>, Jul 11 2022</div> <div class=sectline>For n &gt; 1, a(n) = 2*Sum_{j=1..n-1} Sum_{k=1..j} binomial(2*j,j+k)*(-4*k^2)^(n-1)*(-1)^k/(4^j). - <a href="/wiki/User:Tani_Akinari">Tani Akinari</a>, Sep 20 2023</div> <div class=sectline>a(n) = <a href="/A110501" title="Unsigned Genocchi numbers (of first kind) of even index.">A110501</a>(n) * 4^(n-1) / n (Han and Liu, 2018). - <a href="/wiki/User:Amiram_Eldar">Amiram Eldar</a>, May 17 2024</div> </div> </div> <div class=section> <div class=sectname>EXAMPLE</div> <div class=sectbody> <div class=sectline>tan(x) = x + 2*x^3/3! + 16*x^5/5! + 272*x^7/7! + ... = x + 1/3*x^3 + 2/15*x^5 + 17/315*x^7 + 62/2835*x^9 + O(x^11).</div> <div class=sectline>tanh(x) = x - 1/3*x^3 + 2/15*x^5 - 17/315*x^7 + 62/2835*x^9 - 1382/155925*x^11 + ...</div> <div class=sectline>(sec x)^2 = 1 + x^2 + 2/3*x^4 + 17/45*x^6 + ...</div> <div class=sectline>a(3)=16 because we have: {1, 3, 2, 5, 4}, {1, 4, 2, 5, 3}, {1, 4, 3, 5, 2},</div> <div class=sectline> {1, 5, 2, 4, 3}, {1, 5, 3, 4, 2}, {2, 3, 1, 5, 4}, {2, 4, 1, 5, 3},</div> <div class=sectline> {2, 4, 3, 5, 1}, {2, 5, 1, 4, 3}, {2, 5, 3, 4, 1}, {3, 4, 1, 5, 2},</div> <div class=sectline> {3, 4, 2, 5, 1}, {3, 5, 1, 4, 2}, {3, 5, 2, 4, 1}, {4, 5, 1, 3, 2},</div> <div class=sectline> {4, 5, 2, 3, 1}. - <a href="/wiki/User:Geoffrey_Critzer">Geoffrey Critzer</a>, May 19 2013</div> </div> </div> <div class=section> <div class=sectname>MAPLE</div> <div class=sectbody> <div class=sectline>series(tan(x), x, 40);</div> <div class=sectline>with(numtheory): a := n-&gt; abs(2^(2*n)*(2^(2*n)-1)*bernoulli(2*n)/(2*n));</div> <div class=sectline><a href="/A000182" title="Tangent (or &quot;Zag&quot;) numbers: e.g.f. tan(x), also (up to signs) e.g.f. tanh(x).">A000182</a>_list := proc(n) local T, k, j; T[1] := 1;</div> <div class=sectline>for k from 2 to n do T[k] := (k-1)*T[k-1] od;</div> <div class=sectline> for k from 2 to n do</div> <div class=sectline> for j from k to n do</div> <div class=sectline> T[j] := (j-k)*T[j-1]+(j-k+2)*T[j] od od;</div> <div class=sectline>seq(T[j], j=1..n) end:</div> <div class=sectline><a href="/A000182" title="Tangent (or &quot;Zag&quot;) numbers: e.g.f. tan(x), also (up to signs) e.g.f. tanh(x).">A000182</a>_list(15); # <a href="/wiki/User:Peter_Luschny">Peter Luschny</a>, Apr 02 2012</div> </div> </div> <div class=section> <div class=sectname>MATHEMATICA</div> <div class=sectbody> <div class=sectline>Table[ Sum[2^(2*n + 1 - k)*(-1)^(n + k + 1)*k!*StirlingS2[2*n + 1, k], {k, 1, 2*n + 1}], {n, 0, 7}] (* Victor Adamchik, Oct 05 2005 *)</div> <div class=sectline>v[1] = 2; v[n_] /; n &gt;= 2 := v[n] = Sum[ Binomial[2 n - 3, 2 k - 2] v[k] v[n - k], {k, n - 1}]; Table[ v[n]/2, {n, 15}] (* <a href="/wiki/User:Zerinvary_Lajos">Zerinvary Lajos</a>, Jul 08 2009 *)</div> <div class=sectline>Rest@ Union[ Range[0, 29]! CoefficientList[ Series[ Tan[x], {x, 0, 30}], x]] (* <a href="/wiki/User:Harvey_P._Dale">Harvey P. Dale</a>, Oct 19 2011; modified by <a href="/wiki/User:Robert_G._Wilson_v">Robert G. Wilson v</a>, Apr 02 2012 *)</div> <div class=sectline>t[1, 1] = 1; t[1, 0] = 0; t[n_ /; n &gt; 1, m_] := t[n, m] = m*(m+1)*Sum[t[n-1, k], {k, m-1, n-1}]; a[n_] := t[n, 1]; Table[a[n], {n, 1, 15}] (* <a href="/wiki/User:Jean-Fran莽ois_Alcover">Jean-Fran莽ois Alcover</a>, Jan 02 2013, after <a href="/A064190" title="Triangle T(n,k) generalizing the tangent numbers.">A064190</a> *)</div> <div class=sectline>a[ n_] := If[ n &lt; 1, 0, With[{m = 2 n - 1}, m! SeriesCoefficient[ Tan[x], {x, 0, m}]]]; (* <a href="/wiki/User:Michael_Somos">Michael Somos</a>, Mar 12 2015 *)</div> <div class=sectline>a[ n_] := If[ n &lt; 1, 0, ((-16)^n - (-4)^n) Zeta[1 - 2 n]]; (* <a href="/wiki/User:Michael_Somos">Michael Somos</a>, Mar 12 2015 *)</div> <div class=sectline>Table[2 PolyGamma[2n - 1, 1/2]/Pi^(2n), {n, 1, 10}] (* <a href="/wiki/User:Vladimir_Reshetnikov">Vladimir Reshetnikov</a>, Oct 18 2015 *)</div> <div class=sectline>a[ n_] := a[n] = If[ n &lt; 2, Boole[n == 1], Sum[Binomial[2 n - 2, 2 k - 1] a[k] a[n - k], {k, n - 1}]]; (* <a href="/wiki/User:Michael_Somos">Michael Somos</a>, Aug 02 2018 *)</div> <div class=sectline>a[n_] := (2^(2*n)*(2^(2*n) - 1)*Abs[BernoulliB[2*n]])/(2*n); a /@ Range[20] (* <a href="/wiki/User:Stan_Wagon">Stan Wagon</a>, Nov 21 2022 *)</div> </div> </div> <div class=section> <div class=sectname>PROG</div> <div class=sectbody> <div class=sectline>(PARI) {a(n) = if( n&lt;1, 0, ((-4)^n - (-16)^n) * bernfrac(2*n) / (2*n))};</div> <div class=sectline>(PARI) {a(n) = my(an); if( n&lt;2, n==1, an = vector(n, m, 1); for( m=2, n, an[m] = sum( k=1, m-1, binomial(2*m - 2, 2*k - 1) * an[k] * an[m-k])); an[n])}; /* <a href="/wiki/User:Michael_Somos">Michael Somos</a> */</div> <div class=sectline>(PARI) {a(n) = if( n&lt;1, 0, (2*n - 1)! * polcoeff( tan(x + O(x^(2*n + 2))), 2*n - 1))}; /* <a href="/wiki/User:Michael_Somos">Michael Somos</a> */</div> <div class=sectline>(PARI) {a(n) = my(X=x+x*O(x^n), Egf); Egf = x*sum(m=0, n, prod(k=1, m, tanh(2*k*X))); (n-1)!*polcoeff(Egf, n)} /* <a href="/wiki/User:Paul_D._Hanna">Paul D. Hanna</a>, May 11 2010 */</div> <div class=sectline>(PARI) /* Continued Fraction for the e.g.f. tan(x), from <a href="/wiki/User:Paul_D._Hanna">Paul D. Hanna</a>: */</div> <div class=sectline>{a(n)=local(CF=1+O(x)); for(i=1, n, CF=1/(2*(n-i+1)-1-x^2*CF)); (2*n-1)!*polcoeff(x*CF, 2*n-1)}</div> <div class=sectline>(PARI) /* O.g.f. Sum_{n&gt;=1} a(n)*x^n, from <a href="/wiki/User:Paul_D._Hanna">Paul D. Hanna</a> Feb 05 2013: */</div> <div class=sectline>{a(n)=polcoeff( x+2*x*sum(m=1, n, x^m*prod(k=1, m, (2*k-1)^2/(1+(2*k-1)^2*x +x*O(x^n))) ), n)}</div> <div class=sectline>(Maxima) a(n):=sum(sum(binomial(k, r)*sum(sum(binomial(l, j)/2^(j-1)*sum((-1)^(n)*binomial(j, i)*(j-2*i)^(2*n), i, 0, floor((j-1)/2))*(-1)^(l-j), j, 1, l)*(-1)^l*binomial(r+l-1, r-1), l, 1, 2*n)*(-1)^(1-r), r, 1, k)/k, k, 1, 2*n); /* <a href="/wiki/User:Vladimir_Kruchinin">Vladimir Kruchinin</a>, Aug 23 2010 */</div> <div class=sectline>(Maxima) a[n]:=if n=1 then 1 else 2*sum(sum(binomial(2*j, j+k)*(-4*k^2)^(n-1)*(-1)^k/(4^j), k, 1, j), j, 1, n-1);</div> <div class=sectline>makelist(a[n], n, 1, 30); /* <a href="/wiki/User:Tani_Akinari">Tani Akinari</a>, Sep 20 2023 */</div> <div class=sectline>(Python) # The objective of this implementation is efficiency.</div> <div class=sectline># n -&gt; [0, a(1), a(2), ..., a(n)] for n &gt; 0.</div> <div class=sectline>def <a href="/A000182" title="Tangent (or &quot;Zag&quot;) numbers: e.g.f. tan(x), also (up to signs) e.g.f. tanh(x).">A000182</a>_list(n):</div> <div class=sectline> T = [0 for i in range(1, n+2)]</div> <div class=sectline> T[1] = 1</div> <div class=sectline> for k in range(2, n+1):</div> <div class=sectline> T[k] = (k-1)*T[k-1]</div> <div class=sectline> for k in range(2, n+1):</div> <div class=sectline> for j in range(k, n+1):</div> <div class=sectline> T[j] = (j-k)*T[j-1]+(j-k+2)*T[j]</div> <div class=sectline> return T</div> <div class=sectline>print(<a href="/A000182" title="Tangent (or &quot;Zag&quot;) numbers: e.g.f. tan(x), also (up to signs) e.g.f. tanh(x).">A000182</a>_list(100)) # <a href="/wiki/User:Peter_Luschny">Peter Luschny</a>, Aug 07 2011</div> <div class=sectline>(Python)</div> <div class=sectline>from sympy import bernoulli</div> <div class=sectline>def <a href="/A000182" title="Tangent (or &quot;Zag&quot;) numbers: e.g.f. tan(x), also (up to signs) e.g.f. tanh(x).">A000182</a>(n): return abs(((2-(2&lt;&lt;(m:=n&lt;&lt;1)))*bernoulli(m)&lt;&lt;m-2)//n) # <a href="/wiki/User:Chai_Wah_Wu">Chai Wah Wu</a>, Apr 14 2023</div> <div class=sectline>(Sage) # Algorithm of L. Seidel (1877)</div> <div class=sectline># n -&gt; [a(1), ..., a(n)] for n &gt;= 1.</div> <div class=sectline>def <a href="/A000182" title="Tangent (or &quot;Zag&quot;) numbers: e.g.f. tan(x), also (up to signs) e.g.f. tanh(x).">A000182</a>_list(len) :</div> <div class=sectline> R = []; A = {-1:0, 0:1}; k = 0; e = 1</div> <div class=sectline> for i in (0..2*len-1) :</div> <div class=sectline> Am = 0; A[k + e] = 0; e = -e</div> <div class=sectline> for j in (0..i) : Am += A[k]; A[k] = Am; k += e</div> <div class=sectline> if e &gt; 0 : R.append(A[i//2])</div> <div class=sectline> return R</div> <div class=sectline><a href="/A000182" title="Tangent (or &quot;Zag&quot;) numbers: e.g.f. tan(x), also (up to signs) e.g.f. tanh(x).">A000182</a>_list(15) # <a href="/wiki/User:Peter_Luschny">Peter Luschny</a>, Mar 31 2012</div> </div> </div> <div class=section> <div class=sectname>CROSSREFS</div> <div class=sectbody> <div class=sectline><a href="/A350972" title="E.g.f. = tan(x).">A350972</a> is essentially the same sequence.</div> <div class=sectline>a(n)=2^(n-1)*<a href="/A002105" title="Reduced tangent numbers: 2^n*(2^{2n} - 1)*|B_{2n}|/n, where B_n = Bernoulli numbers.">A002105</a>(n). Apart from signs, 2^(2n-2)*<a href="/A001469" title="Genocchi numbers (of first kind); unsigned coefficients give expansion of x*tan(x/2).">A001469</a>(n) = n*a(n).</div> <div class=sectline>Cf. <a href="/A001469" title="Genocchi numbers (of first kind); unsigned coefficients give expansion of x*tan(x/2).">A001469</a>, <a href="/A002430" title="Numerators in Taylor series for tan(x). Also from Taylor series for tanh(x).">A002430</a>, <a href="/A036279" title="Denominators in the Taylor series for tan(x).">A036279</a>, <a href="/A000364" title="Euler (or secant or &quot;Zig&quot;) numbers: e.g.f. (even powers only) sec(x) = 1/cos(x).">A000364</a> (secant numbers), <a href="/A000111" title="Euler or up/down numbers: e.g.f. sec(x) + tan(x). Also for n &gt;= 2, half the number of alternating permutations on n letters ...">A000111</a> (secant-tangent numbers), <a href="/A024283" title="E.g.f. (1/2) * tan(x)^2 (even powers only).">A024283</a>, <a href="/A009764" title="Tan(x)^2 = sum(n&gt;=0, a(n)*x^(2*n)/(2*n)! ).">A009764</a>. First diagonal of <a href="/A059419" title="Triangle T(n,k) (1 &lt;= k &lt;= n) of tangent numbers, read by rows: T(n,k) = coefficient of x^n/n! in expansion of (tan x)^k/k!.">A059419</a> and of <a href="/A064190" title="Triangle T(n,k) generalizing the tangent numbers.">A064190</a>.</div> <div class=sectline>Cf. <a href="/A009006" title="Expansion of e.g.f.: 1 + tan(x).">A009006</a>, <a href="/A009725" title="Expansion of e.g.f.: tan(x)*(1+x).">A009725</a>, <a href="/A029584" title="Expansion of cos x + tan x + sec x.">A029584</a>, <a href="/A012509" title="E.g.f.: -log(cos(x)*cos(x)) (even powers only).">A012509</a>, <a href="/A009123" title="Expansion of e.g.f.: cosh(log(1+sin(x))).">A009123</a>, <a href="/A009567" title="Expansion of e.g.f.: sinh(log(1 + sin(x))).">A009567</a>.</div> <div class=sectline>Equals <a href="/A002425" title="Denominator of Pi^(2n)/(Gamma(2n)*(1-2^(-2n))*zeta(2n)).">A002425</a>(n) * 2^<a href="/A101921" title="a(2n) = a(n) + 2n - 1, a(2n+1) = 4n.">A101921</a>(n).</div> <div class=sectline>Equals leftmost column of <a href="/A162005" title="The EG1 triangle.">A162005</a>. - <a href="/wiki/User:Johannes_W._Meijer">Johannes W. Meijer</a>, Jun 27 2009</div> <div class=sectline>Cf. <a href="/A258880" title="E.g.f. satisfies: A(x) = Integral 1 + A(x)^3 dx.">A258880</a>, <a href="/A258901" title="E.g.f. satisfies: A(x) = Integral 1 + A(x)^4 dx.">A258901</a>. Cf. <a href="/A002105" title="Reduced tangent numbers: 2^n*(2^{2n} - 1)*|B_{2n}|/n, where B_n = Bernoulli numbers.">A002105</a>, <a href="/A080635" title="Number of permutations on n letters without double falls and without initial falls.">A080635</a>, <a href="/A234797" title="E.g.f. satisfies: A'(x) = 1 + A(x) + 2*A(x)^2, where A(0)=0.">A234797</a>.</div> <div class=sectline>Cf. <a href="/A019538" title="Triangle of numbers T(n,k) = k!*Stirling2(n,k) read by rows (n &gt;= 1, 1 &lt;= k &lt;= n).">A019538</a>, <a href="/A110501" title="Unsigned Genocchi numbers (of first kind) of even index.">A110501</a>.</div> <div class=sectline>Sequence in context: <a href="/A050974" title="Number of binary arrangements on n X n array without three adjacent 1's in a row or column.">A050974</a> <a href="/A012188" title="E.g.f. sinh(arctan(sin(x))) odd powers only.">A012188</a> <a href="/A217816" title="Number of alternating permutations on 2n+1 letters that avoid a certain pattern of length 5 (see Lewis, 2012, Appendix, for ...">A217816</a> * <a href="/A009764" title="Tan(x)^2 = sum(n&gt;=0, a(n)*x^(2*n)/(2*n)! ).">A009764</a> <a href="/A189257" title="Number of n X n binary arrays without the pattern 0 0 1 diagonally, antidiagonally or horizontally">A189257</a> <a href="/A227674" title="Number of n X n 0,1 arrays indicating 2X2 subblocks of some larger (n+1)X(n+1) binary array having an odd sum, with rows and...">A227674</a></div> <div class=sectline>Adjacent sequences: <a href="/A000179" title="M茅nage numbers: a(0) = 1, a(1) = -1, and for n &gt;= 2, a(n) = number of permutations s of [0, ..., n-1] such that s(i) != i a...">A000179</a> <a href="/A000180" title="Expansion of E.g.f. exp(-x)/(1-3x).">A000180</a> <a href="/A000181" title="Coefficients of m茅nage hit polynomials.">A000181</a> * <a href="/A000183" title="Number of discordant permutations of length n.">A000183</a> <a href="/A000184" title="Number of genus 0 rooted maps with 3 faces with n vertices.">A000184</a> <a href="/A000185" title="Coefficients of m茅nage hit polynomials.">A000185</a></div> </div> </div> <div class=section> <div class=sectname>KEYWORD</div> <div class=sectbody> <div class=sectline><span title="a sequence of nonnegative numbers">nonn</span>,<span title="an important sequence">core</span>,<span title="it is very easy to produce terms of sequence">easy</span>,<span title="an exceptionally nice sequence">nice</span></div> </div> </div> <div class=section> <div class=sectname>AUTHOR</div> <div class=sectbody> <div class=sectline><a href="/wiki/User:N._J._A._Sloane">N. J. A. Sloane</a></div> </div> </div> <div class=section> <div class=sectname>STATUS</div> <div class=sectbody> <div class=sectline>approved</div> </div> </div> </div> <div class=space10></div> </div> </div></div> <p> <div class=footerpad></div> <div class=footer> <center> <div class=bottom> <div class=linksbar> <a href="/">Lookup</a> <a href="/wiki/Welcome"><font color="red">Welcome</font></a> <a href="/wiki/Main_Page"><font color="red">Wiki</font></a> <a href="/wiki/Special:RequestAccount">Register</a> <a href="/play.html">Music</a> <a href="/plot2.html">Plot 2</a> <a href="/demo1.html">Demos</a> <a href="/wiki/Index_to_OEIS">Index</a> <a href="/webcam">WebCam</a> <a href="/Submit.html">Contribute</a> <a href="/eishelp2.html">Format</a> <a href="/wiki/Style_Sheet">Style Sheet</a> <a href="/transforms.html">Transforms</a> <a href="/ol.html">Superseeker</a> <a href="/recent">Recents</a> </div> <div class=linksbar> <a href="/community.html">The OEIS Community</a> </div> <div class=linksbar> Maintained by <a href="http://oeisf.org">The OEIS Foundation Inc.</a> </div> <div class=dbinfo>Last modified November 24 12:20 EST 2024. Contains 378082 sequences.</div> <div class=legal> <a href="/wiki/Legal_Documents">License Agreements, Terms of Use, Privacy Policy</a> </div> </div> </center> </div> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10