OFFSET
1,2
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
LINKS
Bishal Deb and Alan D. Sokal, Classical continued fractions for some multivariate polynomials generalizing the Genocchi and median Genocchi numbers, arXiv:2212.07232 [math.CO], 2022. See p. 11.
S. Kitaev and T. Mansour, Simultaneous avoidance of generalized patterns, arXiv:math/0205182 [math.CO], 2002.
H. D. Nguyen and D. Taggart, Mining the OEIS: Ten Experimental Conjectures, 2013. Mentions this sequence. - From N. J. A. Sloane, Mar 16 2014
J. A. Palacios, A. Bhaskar, F. Disanto and N. A. Rosenberg, Enumeration of binary trees compatible with a perfect phylogeny, J. Math. Biol. 84 (2022), 54.
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
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 *)
PROG
(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 */
(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
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
Michael Somos, Dec 03 2001
STATUS
approved