A000660 Boustrophedon transform of 1,1,2,3,4,5,...
1, 2, 5, 14, 41, 136, 523, 2330, 11857, 67912, 432291, 3027166, 23125673, 191389108, 1705788659, 16289080922, 165919213089, 1795666675824, 20576824369027, 248892651678198, 3168999664907705, 42366404751871660, 593368400878431795, 8688251294851280594
Offset: 0
Keywords
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 0..400
- Peter Luschny, An old operation on sequences: the Seidel transform
- J. Millar, N. J. A. Sloane and N. E. Young, A new operation on sequences: the Boustrophedon transform, J. Combin. Theory, 17A 44-54 1996 (Abstract, pdf, ps).
- N. J. A. Sloane, Transforms
- Wikipedia, Boustrophedon transform
- Index entries for sequences related to boustrophedon transform
Programs
-
Haskell
a000660 n = sum $ zipWith (*) (a109449_row n) (1 : [1..]) -- Reinhard Zumkeller, Nov 04 2013
-
Maple
seq(coeff(series(factorial(n)*(x*exp(x)+1)*(sec(x)+tan(x)), x,n+1),x,n),n=0..25); # Muniru A Asiru, Jul 30 2018
-
Mathematica
a[n_] := n! SeriesCoefficient[(1+x Exp[x])(1+Sin[x])/Cos[x], {x, 0, n}]; Table[a[n], {n, 0, 21}] (* Jean-François Alcover, Jul 30 2018, after Sergei N. Gladkovskii *)
-
Python
from itertools import accumulate, count, islice def A000660_gen(): # generator of terms yield 1 blist = (1,) for i in count(1): yield (blist := tuple(accumulate(reversed(blist),initial=i)))[-1] A000660_list = list(islice(A000660_gen(),40)) # Chai Wah Wu, Jun 12 2022
-
Sage
# Algorithm of L. Seidel (1877) def A000660_list(n) : R = []; A = {-1:0, 0:1} k = 0; e = 1 for i in range(n) : Am = i 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 A000660_list(10) # Peter Luschny, Jun 02 2012
Formula
E.g.f.: (x*exp(x) + 1)*(sec(x) + tan(x)). - Sergei N. Gladkovskii, Oct 28 2014
a(n) ~ n! * (2 + Pi*exp(Pi/2)) * (2/Pi)^(n+1). - Vaclav Kotesovec, Jun 12 2015