A135528 1, then repeat 1,0.
1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0
Offset: 1
Examples
G.f. = x + x^2 + x^4 + x^6 + x^8 + x^10 + x^12 + x^14 + x^16 + x^18 + x^20 + ...
Links
- Andrei Asinowski, Cyril Banderier, and Valerie Roitner, Generating functions for lattice paths with several forbidden patterns, (2019).
- Index entries for linear recurrences with constant coefficients, signature (0,1).
Programs
-
Haskell
a135528 n = a135528_list !! (n-1) a135528_list = concat $ iterate ([1,0] *) [1] instance Num a => Num [a] where fromInteger k = [fromInteger k] (p:ps) + (q:qs) = p + q : ps + qs ps + qs = ps ++ qs (0:ps) * qs = 0 : ps * qs (p:ps) * qs'@(q:qs) = p * q : ps * qs' + [p] * qs * = [] -- Reinhard Zumkeller, Apr 02 2011
-
Maple
GS(2,1,200); [see A135416].
-
Mathematica
Prepend[Table[Mod[n + 1, 2], {n, 2, 60}], 1] (* Michael De Vlieger, Mar 17 2015 *) PadRight[{1},120,{0,1}] (* Harvey P. Dale, Apr 23 2024 *)
Formula
G.f.: x*(1+x-x^2)/(1-x^2). - Philippe Deléham, Feb 08 2012
G.f.: x / (1 - x / (1 + x / (1 + x / (1 - x)))). - Michael Somos, Apr 02 2012
a(n) = A049711(n+2) mod 2. - Ctibor O. Zizka, Jan 28 2019
Comments