OFFSET
0,1
COMMENTS
Parity of A064706.
Parity of the generalized pentagonal numbers A001318. - Omar E. Pol, Feb 04 2012
More generally, parity of the generalized k-gonal numbers, for odd k >= 5. - Omar E. Pol, Feb 05 2012
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).
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)
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 *)
PROG
(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
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Philippe Deléham, Sep 07 2009
STATUS
approved