A010674 Period 2: repeat (0,3).
0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (0,1).
Programs
-
Magma
&cat [[0,3]^^50]; // Bruno Berselli, Dec 29 2015
-
Mathematica
3Mod[Range[0, 99], 2] (* Alonso del Arte, Mar 25 2020 *)
-
Maxima
makelist(if evenp(n) then 0 else 3, n, 0, 30); /* Martin Ettl, Nov 09 2012 */
-
PARI
a(n)=n%2*3 \\ Charles R Greathouse IV, Nov 20 2011
-
Scala
(0 to 99).map( % 2 * 3) // _Alonso del Arte, Mar 25 2020
Formula
a(n) = (3/2)*(1 - (-1)^n) = 3*(n mod 2). - Paolo P. Lava, Oct 20 2006
a(n) = A010698(n)/2 - 1. - Martin Ettl, Nov 11 2012
a(n) = 2^(1 - (-1)^n) - 1. - Bruno Berselli, Dec 29 2015
From Chai Wah Wu, Jun 04 2016: (Start)
a(n) = a(n-2) for n >= 2.
G.f.: 3*x/(1 - x^2). (End)
E.g.f.: 3*sinh(x). - Ilya Gutkovskiy, Jun 04 2016
Extensions
More terms from Paolo P. Lava, Oct 20 2006
Comments