A270823 Period 16: repeat [0,2,3,1,1,3,2,0,1,3,2,0,0,2,3,1].
0, 2, 3, 1, 1, 3, 2, 0, 1, 3, 2, 0, 0, 2, 3, 1, 0, 2, 3, 1, 1, 3, 2, 0, 1, 3, 2, 0, 0, 2, 3, 1, 0, 2, 3, 1, 1, 3, 2, 0, 1, 3, 2, 0, 0, 2, 3, 1, 0, 2, 3, 1, 1, 3, 2, 0, 1, 3, 2, 0, 0, 2, 3, 1, 0, 2, 3, 1, 1, 3, 2, 0, 1, 3, 2, 0, 0, 2, 3, 1, 0, 2, 3, 1, 1, 3, 2, 0, 1, 3, 2, 0, 0, 2, 3, 1
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (1,-1,1,0,0,0,0,-1,1,-1,1).
Crossrefs
Cf. A270824.
Programs
-
Mathematica
PadRight[{},120,{0,2,3,1,1,3,2,0,1,3,2,0,0,2,3,1}] (* Harvey P. Dale, May 17 2017 *)
-
PARI
a(n)=[0,2,3,1,1,3,2,0,1,3,2,0,0,2,3,1][n%16+1] \\ Charles R Greathouse IV, Jul 17 2016
Formula
a(n) = (n+1+(15-2n)*[(floor((n+12)/8)) mod 2*(floor((n+3)/2)) mod 2+(floor((n+4)/8)) mod 2*(floor((n+1)/2)) mod 2]) mod 4.
From Chai Wah Wu, Jun 04 2016: (Start)
a(n) = a(n-1) - a(n-2) + a(n-3) - a(n-8) + a(n-9) - a(n-10) + a(n-11) for n > 10.
G.f.: x*(2 + x + x^3 - x^5 + 2*x^8 + x^9)/((1 - x)*(1 + x^2)*(1 + x^8)). (End)
Comments