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!)
A000831 Expansion of e.g.f. (1 + tan(x))/(1 - tan(x)). 20
1, 2, 4, 16, 80, 512, 3904, 34816, 354560, 4063232, 51733504, 724566016, 11070525440, 183240753152, 3266330312704, 62382319599616, 1270842139934720, 27507470234550272, 630424777638805504, 15250953398036463616, 388362339077351014400, 10384044045105304174592 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..432 (first 84 terms from R. J. Mathar)
William Y. C. Chen and Amy M. Fu, The Dumont Ansatz for the Eulerian Polynomials, Peak Polynomials and Derivative Polynomials, arXiv:2204.01497 [math.CO], 2022.
M. S. Tokmachev, Correlations Between Elements and Sequences in a Numerical Prism, Bulletin of the South Ural State University, Ser. Mathematics. Mechanics. Physics, 2019, Vol. 11, No. 1, 24-33.
FORMULA
E.g.f.: tan(x+Pi/4).
a(n) = Sum_{k=1..n} (if even(n+k) ( (-1)^((n+k)/2)*Sum_{j=k..n} (j!*stirling2(n,j)*2^(n-j+1)*(-1)^(j)*binomial(j-1,k-1) ), n>0. - Vladimir Kruchinin, Aug 19 2010
a(n) = 4^n*(E_{n}(1/2) + E_{n}(1))*(-1)^((n^2-n)/2) for n > 0, where E_{n}(x) is an Euler polynomial. - Peter Luschny, Nov 24 2010
a(n) = 2^n * A000111(n). - Gerard P. Michon, Feb 24 2011
From Sergei N. Gladkovskii, Dec 01 2011 - Jan 24 2014: (Start)
Continued fractions:
E.g.f.: -1 + 2/(1-x*G(0)); G(k) = 1 - (x^2)/((x^2) - (2*k + 1)*(2*k + 3)/G(k+1)).
E.g.f.: 1 + 2*x/(U(0)-2*x) where U(k) = 4*k+1 + x/(1+x/ (4*k+3 - x/(1- x/U(k+1)))).
E.g.f.: 1 + 2*x/(G(0)-x) where G(k) = 2*k+1 - x^2/G(k+1).
G.f.: 1 + 2*x/Q(0), where Q(k) = 1 - 2*x*(2*k+1) - 2*x^2*(2*k+1)*(2*k+2)/( 1 - 2*x*(2*k+2) - 2*x^2*(2*k+2)*(2*k+3)/Q(k+1)).
E.g.f.: tan(2*x) + sec(2*x) = (x-1)/(x+1) - 2*(2*x^2+3)/( T(0)*3*x*(1+x)- 2*x^2-3)/(x+1), where T(k) = 1 - x^4*(4*k-1)*(4*k+7)/( x^4*(4*k-1)*(4*k+7) - (4*k+1)*(4*k+5)*(16*k^2 + 8*k - 2*x^2 - 3)*(16*k^2 + 40*k - 2*x^2 + 21)/T(k+1)).
E.g.f.: 1 + 2*x/Q(0), where Q(k) = 4*k+1 -x/(1 - x/( 4*k+3 + x/(1 + x/Q(k+1)))).
E.g.f.: tan(2*x) + sec(2*x) = 2*R(0)-1, where R(k) = 1 + x/( 4*k+1 - x/(1 - x/( 4*k+3 + x/R(k+1)))).
G.f.: 1+ G(0)*2*x/(1-2*x), where G(k) = 1 - 2*x^2*(k+1)*(k+2)/(2*x^2*(k+1)*(k+2) - (1-2*x*(k+1))*(1-2*x*(k+2))/G(k+1)). (End)
a(n) ~ n! * (4/Pi)^(n+1). - Vaclav Kotesovec, Jun 15 2015
a(0) = 1; a(n) = 2 * Sum_{k=0..n-1} binomial(n-2,k) * a(k) * a(n-k-1). - Ilya Gutkovskiy, Jun 11 2020
EXAMPLE
(1+tan x)/(1-tan x) = 1 + 2*x/1! + 4*x^2/2! + 16*x^3/3! + 80*x^4/4! + 512*x^5/5! + ...
MAPLE
A000831 := (1+tan(x))/(1-tan(x)) : for n from 0 to 200 do printf("%d %d ", n, n!*coeftayl(A000831, x=0, n)) ; end: # R. J. Mathar, Nov 19 2006
A000831 := n -> `if`(n=0, 1, (-1)^((n^2-n)/2)*4^n*(euler(n, 1/2)+euler( n, 1))): # Peter Luschny, Nov 24 2010
# third Maple program:
b:= proc(u, o) option remember;
`if`(u+o=0, 1, 2*add(b(o-1+j, u-j), j=1..u))
end:
a:= n-> b(n, 0):
seq(a(n), n=0..25); # Alois P. Heinz, Sep 02 2020
MATHEMATICA
Range[0, 18]! CoefficientList[Series[(1+Tan[x])/(1-Tan[x]), {x, 0, 18}], x] (* Robert G. Wilson v, Apr 16 2011 *)
b[u_, o_] := b[u, o] = If[u+o == 0, 1, 2*Sum[b[o-1+j, u-j], {j, 1, u}]];
a[n_] := b[n, 0];
Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Dec 02 2023, after Alois P. Heinz *)
PROG
(PARI) a(n) = if( n<1, n==0, n! * polcoeff( 1 + 2 / ( 1 / tan( x + x * O(x^n)) - 1), n)) /* Michael Somos, Apr 16 2011 */
(PARI) a(n) = local(A); if( n<0, 0, A = x * O(x^n); n! * polcoeff( (cos(x + A) + sin(x + A)) / (cos(x + A) - sin(x + A)), n)) /* Michael Somos, Apr 16 2011 */
(Maxima) a(n):=sum(if evenp(n+k) then ((-1)^((n+k)/2)*sum(j!*stirling2(n, j)*2^(n-j+1)*(-1)^(j)*binomial(j-1, k-1), j, k, n)) else 0, k, 1, n); /* Vladimir Kruchinin, Aug 19 2010 */
(Sage)
@CachedFunction
def sp(n, x) :
if n == 0 : return 1
return -add(2^(n-k)*sp(k, 1/2)*binomial(n, k) for k in range(n)[::2])
A000831 = lambda n : abs(sp(n, x))
[A000831(n) for n in (0..21)] # Peter Luschny, Jul 30 2012
(SageMath)
def A000831_list(prec):
P.<x> = PowerSeriesRing(QQ, prec)
return P( (1+tan(x))/(1-tan(x)) ).egf_to_ogf().list()
A000831_list(40) # G. C. Greubel, Mar 21 2019; Apr 28 2023
(Magma) m:=30; R<x>:=PowerSeriesRing(Rationals(), m);
Coefficients(R!(Laplace( (1+Tan(x))/(1-Tan(x)) ))); // G. C. Greubel, Mar 21 2019; Apr 28 2023
CROSSREFS
Bisections: A002436 and A012393.
Sequence in context: A115125 A326859 A213010 * A000090 A295922 A300100
KEYWORD
nonn
AUTHOR
STATUS
approved

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 June 27 04:46 EDT 2024. Contains 373727 sequences. (Running on oeis4.)