|
|
A000756
|
|
Boustrophedon transform of sequence 1,1,0,0,0,0,...
|
|
1
|
|
|
1, 2, 3, 5, 13, 41, 157, 699, 3561, 20401, 129881, 909523, 6948269, 57504201, 512516565, 4894172027, 49851629137, 539521049441, 6182455849009, 74781598946211, 952148890494165, 12729293006112121, 178281831561868013
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
LINKS
|
J. Millar, N. J. A. Sloane and N. E. Young, A new operation on sequences: the Boustrophedon transform, J. Combin. Theory, 17A (1996) 44-54 (Abstract, pdf, ps).
|
|
FORMULA
|
E.g.f.: (1 + x)*(tan(x) + sec(x)).
E.g.f.: (1 + x)*(1 + x/U(0)); U(k) = 4*k + 1 - x/(2 - x/(4*k + 3 + x/(2 + x/U(k+1) ))); (continued fraction, 4-step).
E.g.f.: (1 + x)*(1 + 2*x/(U(0) - x)), where U(k) = 4*k + 2 - x^2/U(k+1); (continued fraction, 1-step). (End)
|
|
MATHEMATICA
|
CoefficientList[Series[(1+x)*(Tan[x]+1/Cos[x]), {x, 0, 20}], x]* Range[0, 20]! (* Vaclav Kotesovec, Oct 02 2013 *)
t[n_, 0] := If[n < 2, 1, 0]; 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) # Algorithm of L. Seidel (1877)
R = []; A = {-1:1, 0:1}; 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
A000756_list(22) # Peter Luschny, May 27 2012
(PARI)
x='x+O('x^66);
Vec(serlaplace((1+x)*(tan(x)+ 1/cos(x))))
(Haskell)
a000756 n = sum $ zipWith (*) (a109449_row n) (1 : 1 : [0, 0 ..])
(Python)
from itertools import islice, accumulate
def A000756_gen(): # generator of terms
yield from (1, 2)
blist = (1, 2)
while True:
yield (blist:=tuple(accumulate(reversed(blist), initial=0)))[-1]
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|