A010679 Period 2: repeat (0,8).
0, 8, 0, 8, 0, 8, 0, 8, 0, 8, 0, 8, 0, 8, 0, 8, 0, 8, 0, 8, 0, 8, 0, 8, 0, 8, 0, 8, 0, 8, 0, 8, 0, 8, 0, 8, 0, 8, 0, 8, 0, 8, 0, 8, 0, 8, 0, 8, 0, 8, 0, 8, 0, 8, 0, 8, 0, 8, 0, 8, 0, 8, 0, 8, 0, 8, 0, 8, 0, 8, 0, 8, 0, 8, 0, 8, 0, 8, 0, 8, 0
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (0,1).
Crossrefs
Cf. A010700: 3^(1-(-1)^n) + 1.
Programs
-
Magma
&cat [[0,8]^^40]; // Bruno Berselli, Dec 29 2015
-
Mathematica
PadRight[{},120,{0,8}] (* Harvey P. Dale, Dec 21 2015 *)
-
PARI
a(n)=n%2*8 \\ Charles R Greathouse IV, Jul 26 2016
Formula
a(n) = 4*(1-(-1)^n) = 8*(n mod 2). - Paolo P. Lava, Oct 20 2006
G.f.: 8*x/((1-x)*(1+x)). - R. J. Mathar, Nov 21 2011
a(n) = 3^(1-(-1)^n) - 1. - Bruno Berselli, Dec 29 2015