cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-3 of 3 results.

A065619 Expansion of e.g.f. x * (tan(x) + sec(x)).

Original entry on oeis.org

1, 2, 3, 8, 25, 96, 427, 2176, 12465, 79360, 555731, 4245504, 35135945, 313155584, 2990414715, 30460116992, 329655706465, 3777576173568, 45692713833379, 581777702256640, 7777794952988025, 108932957168730112, 1595024111042171723, 24370173276164456448
Offset: 1

Views

Author

Michael Somos, Dec 03 2001

Keywords

Comments

a(n) is the number of down-up permutations w on [n+1] such that w_2 = 1. For example, a(3)=3 counts 2143, 3142, 4132. - David Callan, Oct 25 2004
A signed variant of this sequence, prefaced with an 0, is column 1 of the inverse of triangle A178616. - Gary W. Adamson, May 30 2010
a(n) is the number of ranked unlabeled binary tree shapes compatible with the binary perfect phylogeny (n,2). - Noah A Rosenberg, Jun 03 2022

Crossrefs

Programs

  • Maple
    A065619 := n -> `if`(n=1,1,2^(n-1)*abs(euler(n-1,1/2)+euler(n-1,1))*n): # Peter Luschny, Nov 25 2010
    # Alternatively (after Alois P. Heinz):
    b := proc(u, o) option remember;
    `if`(u + o = 0, 1, add(b(o - 1 + j, u - j), j = 1..u)) end:
    a := n -> n*b(n-1, 0): seq(a(n), n = 1..24); # Peter Luschny, Oct 27 2017
  • Mathematica
    a[1] = 1; a[n_] := 2^(n-1)*Abs[EulerE[n - 1, 1/2] + EulerE[n - 1, 1]]*n; Array[a, 24] (* Jean-François Alcover, Nov 05 2017, after Peter Luschny *)
    Table[Re[2 n I^n PolyLog[1 - n, -I]], {n, 1, 19}] (* Peter Luschny, Aug 17 2021 *)
  • PARI
    {a(n) = if( n<0, 0 ,n! * polcoeff( x * (tan(x + x * O(x^n)) + 1 / cos(x + x * O(x^n))), n))}
    
  • PARI
    x='x+O('x^66);
    egf=x*(tan(x)+1/cos(x));
    Vec(serlaplace(egf))
    /* Joerg Arndt, May 28 2012 */
    
  • Python
    from itertools import accumulate
    def A065619(n):
        if n <= 2: return n
        blist = (0,1)
        for _ in range(n-2):
            blist = tuple(accumulate(reversed(blist),initial=0))
        return blist[-1]*n # Chai Wah Wu, Apr 25 2023
  • Sage
    # Algorithm of L. Seidel (1877)
    def A065619_list(n) : # starts with a(0) = 0.
        R = []; A = {-1:1, 0:0}; k = 0; e = 1
        for i in (0..n) :
            Am = 0; A[k + e] = 0; e = -e
            for j in (0..i) : Am += A[k]; A[k] = Am; k += e
            R.append(A[-i//2] if i%2 == 0 else A[i//2])
        return R
    A065619_list(22) # Peter Luschny, May 27 2012
    

Formula

E.g.f.: x*(tan(x)+sec(x)).
a(n) = n*A000111(n-1). - R. J. Mathar, Nov 27 2006
a(n) = n*2^(n-1)*|E_{n-1}(1/2)+E_{n-1}(1)| for n > 1; E_{n}(x) Euler polynomial. - Peter Luschny, Nov 25 2010
E.g.f.: x*(tan(x)+sec(x))=x+x^2/U(0);U(k)=4k+1-x/(2-x/(4k+3+x/(2+x/U(k+1))));(continued fraction). - Sergei N. Gladkovskii, Nov 14 2011
E.g.f.: x*( tan(x) + sec(x) )= x + 2*x^2/(U(0)-x) where U(k)= 4*k+2 - x^2/U(k+1);(continued fraction, 1-step). - Sergei N. Gladkovskii, Nov 07 2012
a(n) = (n + 1)!*Re([x^n](1 + i^((n - 1)*n)*(2 - 2*i)/(exp(x) + i))), assuming offset = 0. - Peter Luschny, Aug 09 2021
a(n) = 2*n*i^n*PolyLog(1 - n, -i) for n >= 2. - Peter Luschny, Aug 17 2021

A238801 Triangle T(n,k), read by rows, given by T(n,k) = C(n+1, k+1)*(1-(k mod 2)).

Original entry on oeis.org

1, 2, 0, 3, 0, 1, 4, 0, 4, 0, 5, 0, 10, 0, 1, 6, 0, 20, 0, 6, 0, 7, 0, 35, 0, 21, 0, 1, 8, 0, 56, 0, 56, 0, 8, 0, 9, 0, 84, 0, 126, 0, 36, 0, 1, 10, 0, 120, 0, 252, 0, 120, 0, 10, 0, 11, 0, 165, 0, 462, 0, 330, 0, 55, 0, 1, 12, 0, 220, 0, 792, 0, 792, 0, 220, 0, 12, 0
Offset: 0

Views

Author

Philippe Deléham, Mar 05 2014

Keywords

Comments

Row sums are powers of 2.

Examples

			Triangle begins:
1;
2, 0;
3, 0, 1;
4, 0, 4, 0;
5, 0, 10, 0, 1;
6, 0, 20, 0, 6, 0;
7, 0, 35, 0, 21, 0, 1;
8, 0, 56, 0, 56, 0, 8, 0;
9, 0, 84, 0, 126, 0, 36, 0, 1;
10, 0, 120, 0, 252, 0, 120, 0, 10, 0; etc.
		

Crossrefs

Programs

  • Mathematica
    Table[Binomial[n + 1, k + 1]*(1 - Mod[k , 2]), {n, 0, 10}, {k, 0, n}] // Flatten (* G. C. Greubel, Nov 22 2017 *)
  • PARI
    T(n,k) = binomial(n+1, k+1)*(1-(k % 2));
    tabl(nn) = for (n=0, nn, for (k=0, n, print1(T(n,k), ", ")); print); \\ Michel Marcus, Nov 23 2017

Formula

G.f.: 1/((1+(y-1)*x)*(1-(y+1)*x)).
T(n,k) = 2*T(n-1,k) + T(n-2,k-2) - T(n-2,k), T(0,0) = 1, T(1,0) = 2, T(1,1) = 0, T(n,k) = 0 if k<0 or if k>n.
Sum_{k=0..n} T(n,k)*x^k = A000027(n+1), A000079(n), A015518(n+1), A003683(n+1), A079773(n+1), A051958(n+1), A080920(n+1), A053455(n), A160958(n+1) for x = 0, 1, 2, 3, 4, 5, 6, 7, 8 respectively.

A052950 Expansion of (2-3*x-x^2+x^3)/((1-x)*(1+x)*(1-2*x)).

Original entry on oeis.org

2, 1, 3, 4, 9, 16, 33, 64, 129, 256, 513, 1024, 2049, 4096, 8193, 16384, 32769, 65536, 131073, 262144, 524289, 1048576, 2097153, 4194304, 8388609, 16777216, 33554433, 67108864, 134217729, 268435456, 536870913, 1073741824, 2147483649
Offset: 0

Views

Author

encyclopedia(AT)pommard.inria.fr, Jan 25 2000

Keywords

Comments

Equals row sums of triangle A178616 but replacing the 2 with a 1. - Gary W. Adamson, May 30 2010
Inverse binomial transform is (-1)^n * a(n). - Michael Somos, Jun 03 2014
An autosequence of the second kind whose first kind companion is A005578. - Jean-François Alcover, Mar 18 2020

Examples

			G.f. = 2 + x + 3*x^2 + 4*x^3 + 9*x^4 + 16*x^5 + 33*x^6 + 64*x^7 + 129*x^8 + ...
		

Crossrefs

Cf. A178616. - Gary W. Adamson, May 30 2010

Programs

  • GAP
    Concatenation([2], List([1..40], n-> (2^n +1 +(-1)^n)/2));  # G. C. Greubel, Oct 21 2019
  • Magma
    [2] cat [(2^n +1 +(-1)^n)/2: n in [1..40]]; // G. C. Greubel, Oct 21 2019
    
  • Maple
    spec:= [S,{S=Union(Sequence(Prod(Sequence(Z),Z)), Sequence(Prod(Z,Z)))}, unlabeled ]: seq(combstruct[count ](spec,size=n), n=0..20);
    seq(`if`(n=0, 2, (2^n +1 +(-1)^n)/2), n=0..40); # G. C. Greubel, Oct 21 2019
  • Mathematica
    a[n_]:= (2^n +1 +(-1)^n +Boole[n==0])/2; (* Michael Somos, Jun 03 2014 *)
    a[n_]:= If[ n<0, (1-n)! SeriesCoefficient[Sinh[x] +Exp[x/2], {x,0,1-n}], n! SeriesCoefficient[Cosh[x](1+Exp[x]), {x,0,n}]]; (* Michael Somos, Jun 04 2014 *)
    LinearRecurrence[{2,1,-2}, {2,1,3,4}, 40] (* G. C. Greubel, Oct 21 2019 *)
  • PARI
    {a(n)=(2^n+1+(-1)^n+(n==0))/2}; /* Michael Somos, Jun 03 2014 */
    
  • Sage
    [2]+[(2^n +1 +(-1)^n)/2 for n in (1..40)] # G. C. Greubel, Oct 21 2019
    

Formula

G.f.: (2-3*x-x^2+x^3)/((1-x^2)*(1-2*x)).
a(n) = a(n-1) + 2*a(n-2) - 1.
a(n) = 2^(n-1) + Sum_{alpha=RootOf(-1+z^2)} alpha^(-n)/2.
From Paul Barry, Sep 18 2003: (Start)
a(n) = (2^n + 1 + (-1)^n + 0^n)/2.
E.g.f.: cosh(x)*(1+exp(x)). (End)
a(2*n + 1) = 4 * a(2*n - 1) for all n in Z. a(2*n + 2) = 3*a(2*n + 1) + 2*a(2*n) if n>0. - Michael Somos, Jun 04 2014

Extensions

More terms from James Sellers, Jun 05 2000
Showing 1-3 of 3 results.