|
|
A000667
|
|
Boustrophedon transform of all-1's sequence.
|
|
38
|
|
|
1, 2, 4, 9, 24, 77, 294, 1309, 6664, 38177, 243034, 1701909, 13001604, 107601977, 959021574, 9157981309, 93282431344, 1009552482977, 11568619292914, 139931423833509, 1781662223749884, 23819069385695177, 333601191667149054, 4884673638115922509
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
COMMENTS
|
Fill in a triangle, like Pascal's triangle, beginning each row with a 1 and filling in rows alternately right to left and left to right.
|
|
LINKS
|
J. Millar, N. J. A. Sloane, and N. E. Young, A new operation on sequences: the Boustrophedon transform, J. Combin. Theory Ser. A, 76(1) (1996), 44-54 (Abstract, pdf, ps).
|
|
FORMULA
|
E.g.f.: exp(x) * (tan(x) + sec(x)).
Limit_{n->infinity} 2*n*a(n-1)/a(n) = Pi; lim_{n->infinity} a(n)*a(n-2)/a(n-1)^2 = 1 + 1/(n-1). - Gerald McGarvey, Aug 13 2004
G.f.: E(0)*x/(1-x)/(1-2*x) + 1/(1-x), where E(k) = 1 - x^2*(k + 1)*(k + 2)/(x^2*(k + 1)*(k + 2) - 2*(x*(k + 2) - 1)*(x*(k + 3) - 1)/E(k+1) ); (continued fraction). - Sergei N. Gladkovskii, Jan 16 2014
|
|
EXAMPLE
|
...............1..............
............1..->..2..........
.........4..<-.3...<-..1......
......1..->.5..->..8...->..9..
|
|
MATHEMATICA
|
With[{nn=30}, CoefficientList[Series[Exp[x](Tan[x]+Sec[x]), {x, 0, nn}], x]Range[0, nn]!] (* Harvey P. Dale, Nov 28 2011 *)
t[_, 0] = 1; t[n_, k_] := t[n, k] = t[n, k-1] + t[n-1, n-k];
a[n_] := t[n, n];
|
|
PROG
|
(Sage) # Algorithm of L. Seidel (1877)
R = []; A = {-1:0, 0:0}
k = 0; e = 1
for i in range(n) :
Am = 1
A[k + e] = 0
e = -e
for j in (0..i) :
Am += A[k]
A[k] = Am
k += e
# print [A[z] for z in (-i//2..i//2)]
R.append(A[e*i//2])
return R
(Haskell)
a000667 n = if x == 1 then last xs else x
where xs@(x:_) = a227862_row n
(PARI) x='x+O('x^33); Vec(serlaplace( exp(x)*(tan(x) + 1/cos(x)) ) ) \\ Joerg Arndt, Jul 30 2016
(Python)
from itertools import islice, accumulate
def A000667_gen(): # generator of terms
blist = tuple()
while True:
yield (blist := tuple(accumulate(reversed(blist), initial=1)))[-1]
|
|
CROSSREFS
|
Absolute value of pairwise sums of A009337.
|
|
KEYWORD
|
nonn,easy,nice
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|