A000364 - OEIS (original) (raw)

COMMENTS

Inverse Gudermannian gd^(-1)(x) = log(sec(x) + tan(x)) = log(tan(Pi/4 + x/2)) = arctanh(sin(x)) = 2 * arctanh(tan(x/2)) = 2 * arctanh(csc(x) - cot(x)). - Michael Somos, Mar 19 2011

a(n) is the number of downup permutations of [2n]. Example: a(2)=5 counts 4231, 4132, 3241, 3142, 2143. - David Callan, Nov 21 2011

a(n) is the number of increasing full binary trees on vertices {0,1,2,...,2n} for which the leftmost leaf is labeled 2n. - David Callan, Nov 21 2011

a(n) is the number of unordered increasing trees of size 2n+1 with only even degrees allowed and degree-weight generating function given by cosh(t). - Markus Kuba, Sep 13 2014

a(n) is the number of standard Young tableaux of skew shape (n+1,n,n-1,...,3,2)/(n-1,n-2,...2,1). - Ran Pan, Apr 10 2015

Since cos(z) has a root at z = Pi/2 and no other root in C with a smaller |z|, the radius of convergence of the e.g.f. (intended complex-valued) is Pi/2 = A019669 (see also A028296). - Stanislav Sykora, Oct 07 2016

The sequence starting with a(1) 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 & Buckholtz, 1967, Theorem 2]. - Allen Stenger, Aug 03 2020

Conjecture: taking the sequence [a(n) : n >= 1] modulo an integer k gives a purely periodic sequence with period dividing phi(k). For example, the sequence taken modulo 21 begins [1, 5, 19, 20, 16, 2, 1, 5, 19, 20, 16, 2, 1, 5, 19, 20, 16, 2, 1, 5, 19, ...] with an apparent period of 6 = phi(21)/2. - Peter Bala, May 08 2023

REFERENCES

M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 810; gives a version with signs: E_{2n} = (-1)^n*a(n) (this is A028296).

Miklos Bona, editor, Handbook of Enumerative Combinatorics, CRC Press, 2015, page 932.

J. M. Borwein and D. M. Bailey, Mathematics by Experiment, Peters, Boston, 2004; p. 49

J. M. Borwein, D. H. Bailey, and R. Girgensohn, Experimentation in Mathematics, A K Peters, Ltd., Natick, MA, 2004. x+357 pp. See p. 141.

G. Chrystal, Algebra, Vol. II, p. 342.

L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 49.

John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See p. 110.

H. Doerrie, 100 Great Problems of Elementary Mathematics, Dover, NY, 1965, p. 69.

L. Euler, Inst. Calc. Diff., Section 224.

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

L. Seidel, Über eine einfache Entstehungsweise der Bernoulli'schen 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.

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).

Jerome Spanier and Keith B. Oldham, "Atlas of Functions", Hemisphere Publishing Corp., 1987, chapters 5 and 33, pages 41, 314.

J. V. Uspensky and M. A. Heaslet, Elementary Number Theory, McGraw-Hill, NY, 1939, p. 269.

LINKS

M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards, Applied Math. Series 55, Tenth Printing, 1972 [alternative scanned copy].

D. Foata and M.-P. Schutzenberger, Nombres d'Euler et permutations alternantes, in J. N. Srivastava et al., eds., A Survey of Combinatorial Theory (North Holland Publishing Company, Amsterdam, 1973), pp. 173-187.

FORMULA

E.g.f.: Sum_{n >= 0} a(n) * x^(2*n) / (2*n)! = sec(x). - Michael Somos, Aug 15 2007

E.g.f.: Sum_{n >= 0} a(n) * x^(2*n+1) / (2*n+1)! = gd^(-1)(x). - Michael Somos, Aug 15 2007

E.g.f.: Sum_{n >= 0} a(n)*x^(2*n+1)/(2*n+1)! = 2*arctanh(cosec(x)-cotan(x)). - Ralf Stephan, Dec 16 2004

Pi/4 - [Sum_{k=0..n-1} (-1)^k/(2*k+1)] ~ (1/2)*[Sum_{k>=0} (-1)^k*E(k)/(2*n)^(2k+1)] for positive even n. [Borwein, Borwein, and Dilcher]

Also, for positive odd n, log(2) - Sum_{k = 1..(n-1)/2} (-1)^(k-1)/k ~ (-1)^((n-1)/2) * Sum_{k >= 0} (-1)^k*E(k)/n^(2*k+1), where E(k) is the k-th Euler number, by Borwein, Borwein, and Dilcher, Lemma 2 with f(x) := 1/(x + 1/2), h := 1/2 and then replace x with (n-1)/2. - Peter Bala, Oct 29 2016

Let M_n be the n X n matrix M_n(i, j) = binomial(2*i, 2*(j-1)) = A086645(i, j-1); then for n>0, a(n) = det(M_n); example: det([1, 1, 0, 0; 1, 6, 1, 0; 1, 15, 15, 1; 1, 28, 70, 28 ]) = 1385. - Philippe Deléham, Sep 04 2005

This sequence is also (-1)^n*EulerE(2*n) or abs(EulerE(2*n)). - Paul Abbott (paul(AT)physics.uwa.edu.au), Apr 14 2006

a(n) = 2^n * E_n(1/2), where E_n(x) is an Euler polynomial.

a(k) = a(j) (mod 2^n) if and only if k == j (mod 2^n) (k and j are even). [Stern; see also Wagstaff and Sun]

E_k(3^(k+1)+1)/4 = (3^k/2)*Sum_{j=0..2^n-1} (-1)^(j-1)*(2j+1)^k*[(3j+1)/2^n] (mod 2^n) where k is even and [x] is the greatest integer function. [Sun]

a(n) ~ 2^(2*n+2)*(2*n)!/Pi^(2*n+1) as n -> infinity. [corrected by Vaclav Kotesovec, Jul 10 2021]

Recurrence: a(n) = -(-1)^n*Sum_{i=0..n-1} (-1)^i*a(i)*binomial(2*n, 2*i). - Ralf Stephan, Feb 24 2005

O.g.f.: 1/(1-x/(1-4*x/(1-9*x/(1-16*x/(...-n^2*x/(1-...)))))) (continued fraction due to T. J. Stieltjes). - Paul D. Hanna, Oct 07 2005

a(n) = (Integral_{t=0..Pi} log(tan(t/2)^2)^(2n)dt)/Pi^(2n+1). - Logan Kleinwaks (kleinwaks(AT)alumni.princeton.edu), Mar 15 2007

Basic hypergeometric generating function: 2*exp(-t)*Sum {n >= 0} Product_{k = 1..n} (1-exp(-(4*k-2)*t))*exp(-2*n*t)/Product_{k = 1..n+1} (1+exp(-(4*k-2)*t)) = 1 + t + 5*t^2/2! + 61*t^3/3! + .... For other sequences with generating functions of a similar type see A000464, A002105, A002439, A079144 and A158690.

a(n) = 2*(-1)^n*L(-2*n), where L(s) is the Dirichlet L-function L(s) = 1 - 1/3^s + 1/5^s - + .... (End)

Sum_{n>=0} a(n)*z^(2*n)/(4*n)!! = Beta(1/2-z/(2*Pi),1/2+z/(2*Pi))/Beta(1/2,1/2) with Beta(z,w) the Beta function. - Johannes W. Meijer, Jul 06 2009

a(n) = Sum_(Sum_(binomial(k,m)*(-1)^(n+k)/(2^(m-1))*Sum_(binomial(m,j)*(2*j-m)^(2*n),j,0,m/2)*(-1)^(k-m),m,0,k),k,1,2*n), n>0. - Vladimir Kruchinin, Aug 05 2010

If n is prime, then a(n)==1 (mod 2*n). - Vladimir Shevelev, Sep 04 2010

(1)... a(n) = (-1/4)^n*B(2*n,-1),

where {B(n,x)}n>=1 = [1, 1+x, 1+6*x+x^2, 1+23*x+23*x^2+x^3, ...] is the sequence of Eulerian polynomials of type B - see A060187. Equivalently,

(2)... a(n) = Sum_{k = 0..2*n} Sum_{j = 0..k} (-1)^(n-j) *binomial(2*n+1,k-j)*(j+1/2)^(2*n).

We also have

(3)... a(n) = 2*A(2*n,i)/(1+i)^(2*n+1),

where i = sqrt(-1) and where {A(n,x)}n>=1 = [x, x + x^2, x + 4*x^2 + x^3, ...] denotes the sequence of Eulerian polynomials - see A008292. Equivalently,

(4)... a(n) = i*Sum_{k = 1..2*n} (-1)^(n+k)*k!*Stirling2(2*n,k) *((1+i)/2)^(k-1)

= i*Sum_{k = 1..2*n} (-1)^(n+k)*((1+i)/2)^(k-1) Sum_{j = 0..k} (-1)^(k-j)*binomial(k,j)*j^(2*n).

Either this explicit formula for a(n) or (2) above may be used to obtain congruence results for a(n). For example, for prime p

(5a)... a(p) = 1 (mod p)

(5b)... a(2*p) = 5 (mod p)

and for odd prime p

(6a)... a((p+1)/2) = (-1)^((p-1)/2) (mod p)

(6b)... a((p-1)/2) = -1 + (-1)^((p-1)/2) (mod p).

(End)

a(n) = (-1)^n*2^(4*n+1)*(zeta(-2*n,1/4) - zeta(-2*n,3/4)). - Gerry Martens, May 27 2011

a(n) may be expressed as a sum of multinomials taken over all compositions of 2*n into even parts (Vella 2008): a(n) = Sum_{compositions 2*i_1 + ... + 2*i_k = 2*n} (-1)^(n+k)* multinomial(2*n, 2*i_1, ..., 2*i_k). For example, there are 4 compositions of the number 6 into even parts, namely 6, 4+2, 2+4 and 2+2+2, and hence a(3) = 6!/6! - 6!/(4!*2!) - 6!/(2!*4!) + 6!/(2!*2!*2!) = 61. A companion formula expressing a(n) as a sum of multinomials taken over the compositions of 2*n-1 into odd parts has been given by Malenfant 2011. - Peter Bala, Jul 07 2011

a(n) = the upper left term in M^n, where M is an infinite square production matrix; M[i,j] = A000290(i) = i^2, i >= 1 and 1 <= j <= i+1, and M[i,j] = 0, i >= 1 and j >= i+2 (see examples). - Gary W. Adamson, Jul 18 2011

E.g.f. A'(x) satisfies the differential equation A'(x)=cos(A(x)). - Vladimir Kruchinin, Nov 03 2011

a(n) = D^(2*n)(cosh(x)) evaluated at x = 0, where D is the operator cosh(x)*d/dx. a(n) = D^(2*n-1)(f(x)) evaluated at x = 0, where f(x) = 1+x+x^2/2! and D is the operator f(x)*d/dx.

Other generating functions: cosh(Integral_{t = 0..x} 1/cos(t)) dt = 1 + x^2/2! + 5*x^4/4! + 61*x^6/6! + 1385*x^8/8! + .... Cf. A012131.

A(x) := arcsinh(tan(x)) = log( sec(x) + tan(x) ) = x + x^3/3! + 5*x^5/5! + 61*x^7/7! + 1385*x^9/9! + .... A(x) satisfies A'(x) = cosh(A(x)).

B(x) := Series reversion( log(sec(x) + tan(x)) ) = x - x^3/3! + 5*x^5/5! - 61*x^7/7! + 1385*x^9/9! - ... = arctan(sinh(x)). B(x) satisfies B'(x) = cos(B(x)). (End)

a(0) = 1 and, for n > 0, a(n) = (-1)^n*((4*n+1)/(2*n+1) - Sum_{k = 1..n} (4^(2*k)/2*k)*binomial(2*n,2*k-1)*A000367(k)/A002445(k)); see the Bucur et al. link. - L. Edson Jeffery, Sep 17 2012

O.g.f.: Sum_{n>=0} (2*n)!/2^n * x^n / Product_{k=1..n} (1 + k^2*x). - Paul D. Hanna, Sep 20 2012

Continued fractions:

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

E.g.f.: 2/Q(0) where Q(k) = 1 + 1/(1 - x^2/(x^2 - 2*(k+1)*(2*k+1)/Q(k+1))).

G.f.: 1/Q(0) where Q(k) = 1 + x*k*(3*k-1) - x*(k+1)*(2*k+1)*(x*k^2+1)/Q(k+1).

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

E.g.f.: 1/cos(x) = 8*(x^2+1)/(4*x^2 + 8 - x^4*U(0)) where U(k) = 1 + 4*(k+1)*(k+2)/(2*k+3 - x^2*(2*k+3)/(x^2 - 8*(k+1)*(k+2)*(k+3)/U(k+1))).

G.f.: 1/U(0) where U(k) = 1 + x - x*(2*k+1)*(2*k+2)/(1 - x*(2*k+1)*(2*k+2)/U(k+1)).

G.f.: 1 + x/G(0) where G(k) = 1 + x - x*(2*k+2)*(2*k+3)/(1 - x*(2*k+2)*(2*k+3)/G(k+1)).

Let F(x) = sec(x^(1/2)) = Sum_{n>=0} a(n)*x^n/(2*n)!, then F(x)=2/(Q(0) + 1) where Q(k)= 1 - x/(2*k+1)/(2*k+2)/(1 - 1/(1 + 1/Q(k+1))).

G.f.: Q(0), where Q(k) = 1 - x*(k+1)^2/( x*(k+1)^2 - 1/Q(k+1)).

E.g.f.: 1/cos(x) = 1 + x^2/(2-x^2)*Q(0), where Q(k) = 1 - 2*x^2*(k+1)*(2*k+1)/( 2*x^2*(k+1)*(2*k+1)+ (12-x^2 + 14*k + 4*k^2)*(2-x^2 + 6*k + 4*k^2)/Q(k+1)). (End)

a(n) = Sum_{k=1..2*n} (Sum_{i=0..k-1} (i-k)^(2*n)*binomial(2*k,i)*(-1)^(i+k+n)) / 2^(k-1) for n>0, a(0)=1. - Vladimir Kruchinin, Oct 05 2012

It appears that a(n) = 3*A076552(n -1) + 2*(-1)^n for n >= 1. Conjectural congruences: a(2*n) == 5 (mod 60) for n >= 1 and a(2*n+1) == 1 (mod 60) for n >= 0. - Peter Bala, Jul 26 2013

O.g.f.: Sum_{n >= 0} 1/2^n * Sum_{k = 0..n} (-1)^k*binomial(n,k)/(1 - sqrt(-x)*(2*k + 1)) = Sum_{n >= 0} 1/2^n * Sum_{k = 0..n} (-1)^k*binomial(n,k)/(1 + x*(2*k + 1)^2).

O.g.f. is 1 + x*d/dx(log(F(x))), where F(x) = 1 + x + 3*x^2 + 23*x^3 + 371*x^4 + ... is the o.g.f. for A255881. (End)

Sum_(n >= 1, A034947(n)/n^(2d+1)) = a(d)*Pi^(2d+1)/(2^(2d+2)-2)(2d)! for d >= 0; see Allouche and Sondow, 2015. - Jonathan Sondow, Mar 21 2015

Asymptotic expansion: 4*(4*n/(Pi*e))^(2*n+1/2)*exp(1/2+1/(24*n)-1/(2880*n^3) +1/(40320*n^5)-...). (See the Luschny link.) - Peter Luschny, Jul 14 2015

a(n) = 2*(-1)^n*Im(Li_{-2n}(i)), where Li_n(x) is polylogarithm, i=sqrt(-1). - Vladimir Reshetnikov, Oct 22 2015

Limit_{n->infinity} ((2*n)!/a(n))^(1/(2*n)) = Pi/2. - Stanislav Sykora, Oct 07 2016

O.g.f.: 1/(1 + x - 2*x/(1 - 2*x/(1 + x - 12*x/(1 - 12*x/(1 + x - 30*x/(1 - 30*x/(1 + x - ... - (2*n - 1)*(2*n)*x/(1 - (2*n - 1)*(2*n)*x/(1 + x - ... ))))))))). - Peter Bala, Nov 09 2017

For n>0, a(n) = (-PolyGamma(2*n, 1/4) / 2^(2*n - 1) - (2^(2*n + 2) - 2) * Gamma(2*n + 1) * zeta(2*n + 1)) / Pi^(2*n + 1). - Vaclav Kotesovec, May 04 2020

a(n) ~ 2^(4*n + 3) * n^(2*n + 1/2) / (Pi^(2*n + 1/2) * exp(2*n)) * exp(Sum_{k>=1} bernoulli(k+1) / (k*(k+1)*2^k*n^k)). - Vaclav Kotesovec, Mar 05 2021

Peter Bala's conjectured congruences, a(2n) == 5 (mod 60) for n >= 1 and a(2n + 1) == 1 (mod 60), hold due to the results of Stern (mod 4) and Knuth & Buckholtz (mod 3 and 5). - Charles R Greathouse IV, Mar 23 2022

EXAMPLE

G.f. = 1 + x + 5*x^2 + 61*x^3 + 1385*x^4 + 50521*x^5 + 2702765*x^6 + 199360981*x^7 + ...

sec(x) = 1 + 1/2*x^2 + 5/24*x^4 + 61/720*x^6 + ...

The first few rows of matrix M are:

1, 1, 0, 0, 0, ...

4, 4, 4, 0, 0, ...

9, 9, 9, 9, 0, ...

16, 16, 16, 16, 16, ... (End)

MAPLE

series(sec(x), x, 40): SERIESTOSERIESMULT(%): subs(x=sqrt(y), %): seriestolist(%);

# end of program

[A000364](/A000364 "Euler (or secant or "Zig") numbers: e.g.f. (even powers only) sec(x) = 1/cos(x).")_list := proc(n) local S, k, j; S[0] := 1;

for k from 1 to n do S[k] := k*S[k-1] od;

for k from 1 to n do

for j from k to n do

S[j] := (j-k)*S[j-1]+(j-k+1)*S[j] od od;

seq(S[j], j=1..n) end:

abs(euler(2*n)) ;

MATHEMATICA

Take[ Range[0, 32]! * CoefficientList[ Series[ Sec[x], {x, 0, 32}], x], {1, 32, 2}] (* Robert G. Wilson v, Apr 23 2006 *)

Table[Abs[EulerE[2n]], {n, 0, 30}] (* Ray Chandler, Mar 20 2007 *)

a[ n_] := If[ n < 0, 0, With[{m = 2 n}, m! SeriesCoefficient[ Sec[ x], {x, 0, m}]]]; (* Michael Somos, Nov 22 2013 *)

a[ n_] := If[ n < 0, 0, With[{m = 2 n + 1}, m! SeriesCoefficient[ InverseGudermannian[ x], {x, 0, m}]]]; (* Michael Somos, Nov 22 2013 *)

a[n_] := Sum[Sum[Binomial[k, m] (-1)^(n+k)/(2^(m-1)) Sum[Binomial[m, j]* (2j-m)^(2n), {j, 0, m/2}] (-1)^(k-m), {m, 0, k}], {k, 1, 2n}]; Table[ a[n], {n, 0, 16}] (* Jean-François Alcover, Jun 26 2019, after Vladimir Kruchinin *)

a[0] := 1; a[n_] := a[n] = -Sum[a[n - k]/(2 k)!, {k, 1, n}]; Map[(-1)^# (2 #)! a[#] &, Range[0, 16]] (* Oliver Seipel, May 18 2024 *)

PROG

(PARI) {a(n)=local(CF=1+x*O(x^n)); if(n<0, return(0), for(k=1, n, CF=1/(1-(n-k+1)^2*x*CF)); return(Vec(CF)[n+1]))} \\ Paul D. Hanna Oct 07 2005

(PARI) {a(n) = if( n<0, 0, (2*n)! * polcoeff( 1 / cos(x + O(x^(2*n + 1))), 2*n))}; /* Michael Somos, Jun 18 2002 */

(PARI) {a(n) = my(A); if( n<0, 0, n = 2*n+1 ; A = x * O(x^n); n! * polcoeff( log(1 / cos(x + A) + tan(x + A)), n))}; /* Michael Somos, Aug 15 2007 */

(PARI) {a(n)=polcoeff(sum(m=0, n, (2*m)!/2^m * x^m/prod(k=1, m, 1+k^2*x+x*O(x^n))), n)} \\ Paul D. Hanna, Sep 20 2012

(PARI) list(n)=my(v=Vec(1/cos(x+O(x^(2*n+1))))); vector(n, i, v[2*i-1]*(2*i-2)!) \\ Charles R Greathouse IV, Oct 16 2012

(PARI) a(n)=subst(bernpol(2*n+1), 'x, 1/4)*4^(2*n+1)*(-1)^(n+1)/(2*n+1) \\ Charles R Greathouse IV, Dec 10 2014

(Maxima) a(n):=sum(sum(binomial(k, m)*(-1)^(n+k)/(2^(m-1))*sum(binomial(m, j)*(2*j-m)^(2*n), j, 0, m/2)*(-1)^(k-m), m, 0, k), k, 1, 2*n); /* Vladimir Kruchinin, Aug 05 2010 */

(Maxima) a[n]:=if n=0 then 1 else sum(sum((i-k)^(2*n)*binomial(2*k, i)*(-1)^(i+k+n), i, 0, k-1)/ (2^(k-1)), k, 1, 2*n); makelist(a[n], n, 0, 16); /* Vladimir Kruchinin, Oct 05 2012 */

(Sage)

# Algorithm of L. Seidel (1877)

# n -> [a(0), a(1), ..., a(n-1)] for n > 0.

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

for i in (0..2*len-1) :

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

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

if e < 0 : R.append(A[-i//2])

return R

(Python)

from functools import lru_cache

from math import comb

@lru_cache(maxsize=None)

def [A000364](/A000364 "Euler (or secant or "Zig") numbers: e.g.f. (even powers only) sec(x) = 1/cos(x).")(n): return 1 if n == 0 else (1 if n % 2 else -1)*sum((-1 if i % 2 else 1)*[A000364](/A000364 "Euler (or secant or "Zig") numbers: e.g.f. (even powers only) sec(x) = 1/cos(x).")(i)*comb(2*n, 2*i) for i in range(n)) # Chai Wah Wu, Jan 14 2022

CROSSREFS

Cf. A000111, [A000182](/A000182 "Tangent (or "Zag") numbers: e.g.f. tan(x), also (up to signs) e.g.f. tanh(x)."), A011248, A019669, A034947, A060075, A013525, A000816, A002436, A000464, A002105, A002439, A079144, A158690.

First column of triangle A060074.

Two main diagonals of triangle A060058 (as iterated sums of squares).

Bisection (even part) of A317139.

The sequences [(-k^2)^n*Euler(2*n, 1/k), n = 0, 1, ...] are: A000007 (k=1), [A000364](/A000364 "Euler (or secant or "Zig") numbers: e.g.f. (even powers only) sec(x) = 1/cos(x).") (k=2), |A210657| (k=3), A000281 (k=4), A272158 (k=5), A002438 (k=6), A273031 (k=7).