A131743 Period 4: repeat [0, 1, 0, 2].
0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (0,0,0,1).
Crossrefs
Cf. A006368.
Programs
-
Magma
&cat [[0, 1, 0, 2]^^30]; // Bruno Berselli, Mar 22 2016
-
Maple
seq(op([0, 1, 0, 2]), n=0..50); # Wesley Ivan Hurt, Jul 09 2016
-
Mathematica
PadRight[{}, 106, {0, 1, 0, 2}] (* Harvey P. Dale, Apr 06 2012 *) CoefficientList[Series[x (1 + 2 x^2)/((1 - x) (x + 1) (x^2 + 1)), {x, 0, 120}], x] (* Michael De Vlieger, Jul 09 2016 *)
-
PARI
x='x+O('x^200); concat(0, Vec(-x*(1+2*x^2)/((x-1)*(x+1)*(x^2+1)))) \\ Altug Alkan, Mar 22 2016
-
PARI
a(n)=n%2*(n%4+1)/2 \\ Charles R Greathouse IV, Mar 22 2016
-
Python
def A131743(n): return (0,1,0,2)[n&3] # Chai Wah Wu, Jul 29 2023
Formula
G.f.: x*(1+2*x^2)/ ((1-x)*(x+1)*(x^2+1)). - R. J. Mathar, Nov 15 2007
a(n) = 3/4-1/2*sin(1/2*Pi*n)+3/4*(-1)^(1+n). - R. J. Mathar, Nov 15 2007
a(n) = Fibonacci(2*n) mod 3. - Gary Detlefs Feb 13 2011
a(n) == A006368(n) (mod 3). - Philippe Deléham, Oct 24 2011
a(n) = a(n-4) for n>3. - Wesley Ivan Hurt, Jul 09 2016
Comments