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.

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