%I #54 Aug 30 2024 15:01:54
%S 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,
%T 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,
%U 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
%N Period 8: repeat [0,1,0,1,1,0,1,0].
%C Parity of A064706.
%C Parity of the generalized pentagonal numbers A001318. - _Omar E. Pol_, Feb 04 2012
%C More generally, parity of the generalized k-gonal numbers, for odd k >= 5. - _Omar E. Pol_, Feb 05 2012
%H Colin Barker, <a href="/A165211/b165211.txt">Table of n, a(n) for n = 0..1000</a>
%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,0,-1,1).
%F a(n) = A002817(n) mod 2. - _Wesley Ivan Hurt_, Apr 23 2014
%F a(n) = 1/2 - (-1)^(n*(n+1)*(n^2 + n + 2)/8)/2. - _Vaclav Kotesovec_, Apr 28 2014
%F From _Colin Barker_, Dec 20 2017: (Start)
%F G.f.: x*(1 - x + x^2) / ((1 - x)*(1 + x^4)).
%F a(n) = a(n-1) - a(n-4) + a(n-5) for n>4.
%F (End)
%t PadRight[{},112,{0,1,0,1,1,0,1,0}] (* _Harvey P. Dale_, Jan 29 2012 *)
%t Table[Mod[n*(n+1)*(n^2+n+2)/8,2],{n,0,100}] (* _Vaclav Kotesovec_, Apr 28 2014 after _Wesley Ivan Hurt_ *)
%o (PARI) a(n)=bitxor(n, n\4)%2 \\ _Charles R Greathouse IV_, Jul 13 2016
%o (PARI) concat(0, Vec(x*(1 - x + x^2) / ((1 - x)*(1 + x^4)) + O(x^100))) \\ _Colin Barker_, Dec 20 2017
%o (Python)
%o def A165211(n): return n&1^bool(n&4) # _Chai Wah Wu_, Aug 30 2024
%Y Cf. A001318, A002817, A064706.
%Y Cf. A130198 (essentially the same).
%K nonn,easy
%O 0,1
%A _Philippe Deléham_, Sep 07 2009