|
|
A062162
|
|
Boustrophedon transform of (-1)^n.
|
|
9
|
|
|
1, 0, 0, 1, 0, 5, 10, 61, 280, 1665, 10470, 73621, 561660, 4650425, 41441530, 395757181, 4031082640, 43626778785, 499925138190, 6046986040741, 76992601769220, 1029315335116745, 14416214547400450, 211085887742964301, 3225154787165157400, 51329932704636904305
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,6
|
|
COMMENTS
|
|
|
LINKS
|
|
|
FORMULA
|
G.f.: E(0)*x/(1+x) + 1/(1+x), where E(k) = 1 - x^2*(k+1)*(k+2)/(x^2*(k+1)*(k+2) - 2*(x*k-1)*(x*(k+1)-1)/E(k+1) ); (continued fraction). - Sergei N. Gladkovskii, Jan 16 2014
|
|
MATHEMATICA
|
CoefficientList[Series[E^(-x)*(Tan[x]+1/Cos[x]), {x, 0, 20}], x]* Range[0, 20]! (* Vaclav Kotesovec, Oct 05 2013 *)
t[n_, 0] := (-1)^n; t[n_, k_] := t[n, k] = t[n, k-1] + t[n-1, n-k]; a[n_] := t[n, n]; Array[a, 30, 0] (* Jean-François Alcover, Feb 12 2016 *)
|
|
PROG
|
(Sage) # Generalized algorithm of L. Seidel (1877)
R = []; A = {-1:0, 0:0}
k = 0; e = 1
for i in range(n) :
Am = (-1)^i
A[k + e] = 0
e = -e
for j in (0..i) :
Am += A[k]
A[k] = Am
k += e
R.append(A[e*i//2])
return R
(Haskell)
(Python)
from itertools import islice, accumulate
def A062162_gen(): # generator of terms
blist, m = tuple(), -1
while True:
yield (blist := tuple(accumulate(reversed(blist), initial=(m:=-m))))[-1]
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|