A165211 Period 8: repeat [0,1,0,1,1,0,1,0].
0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0
Offset: 0
Links
- Colin Barker, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (1,0,0,-1,1).
Programs
-
Mathematica
PadRight[{},112,{0,1,0,1,1,0,1,0}] (* Harvey P. Dale, Jan 29 2012 *) Table[Mod[n*(n+1)*(n^2+n+2)/8,2],{n,0,100}] (* Vaclav Kotesovec, Apr 28 2014 after Wesley Ivan Hurt *)
-
PARI
a(n)=bitxor(n, n\4)%2 \\ Charles R Greathouse IV, Jul 13 2016
-
PARI
concat(0, Vec(x*(1 - x + x^2) / ((1 - x)*(1 + x^4)) + O(x^100))) \\ Colin Barker, Dec 20 2017
-
Python
def A165211(n): return n&1^bool(n&4) # Chai Wah Wu, Aug 30 2024
Formula
a(n) = A002817(n) mod 2. - Wesley Ivan Hurt, Apr 23 2014
a(n) = 1/2 - (-1)^(n*(n+1)*(n^2 + n + 2)/8)/2. - Vaclav Kotesovec, Apr 28 2014
From Colin Barker, Dec 20 2017: (Start)
G.f.: x*(1 - x + x^2) / ((1 - x)*(1 + x^4)).
a(n) = a(n-1) - a(n-4) + a(n-5) for n>4.
(End)
Comments