A010698 Period 2: repeat (2,8).
2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2, 8, 2
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (0,1).
Programs
-
Maple
A010698:=n->5-3*(-1)^n; seq(A010698(n), n=0..100); # Wesley Ivan Hurt, Mar 26 2014
-
Mathematica
Table[5-3(-1)^n, {n, 0, 100}] (* Wesley Ivan Hurt, Mar 26 2014 *) PadRight[{},120,{2,8}] (* Harvey P. Dale, Oct 31 2016 *)
-
Maxima
A010698(n):=if evenp(n) then 2 else 8$ makelist(A010698(n),n,0,30); /* Martin Ettl, Nov 09 2012 */
-
PARI
a(n)=n%2*6+2 \\ Charles R Greathouse IV, Jun 11 2015
Formula
a(n) = -3*(-1)^n+5. - Paolo P. Lava, Oct 20 2006
G.f.: 2(1+4x)/((1-x)(1+x)). a(n) = 2*A010685(n). - R. J. Mathar, Oct 20 2008
a(n) = (A010674(n)+1)*2. - Martin Ettl, Nov 09 2012
Comments