login
A198517
Period 5: repeat [1,0,1,0,0].
5
1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1
OFFSET
0
COMMENTS
Unsigned version of A105385; also partial sums of A156174.
FORMULA
G.f.: (1+x^2)/(1-x^5) = (1+x^2)/((1-x)*(1+x+x^2+x^3+x^4)).
a(n) = a(-n+2) = (1/25)*(-4*(n mod 5) + ((n+1) mod 5) + 6*((n+2) mod 5) - 4*((n+3) mod 5) + 6*((n+4) mod 5)).
a(n) + a(n+1) + a(n+2) = A177706(n+4).
a(n) - a(n+2) + a(n+4) = A011658(n+2).
a(n) = ((n+4)^2 mod 5 + (n+4)^4 mod 5)/2. - Gary Detlefs, May 29 2012
a(n) = (2/5) * (1 + cos(2*(n-2)*Pi/5) + cos(4*(n-2)*Pi/5) + cos(2*n*Pi/5) + cos(4*n*Pi/5)). - Wesley Ivan Hurt, Sep 26 2018
a(n) = floor(((2*n-1) mod 5)/3). - Wesley Ivan Hurt, Apr 29 2020
MATHEMATICA
PadRight[{}, 120, {1, 0, 1, 0, 0}] (* Harvey P. Dale, Dec 09 2012 *)
PROG
(Magma) &cat[[1, 0, 1, 0, 0]^^20];
(Magma) [((n+1) mod 5) mod 2: n in [0..100]]; // Vincenzo Librandi, Feb 18 2015
(PARI) a(n)=n%5==0 || n%5==2 \\ Charles R Greathouse IV, Oct 28 2011
CROSSREFS
Cf. A079998. See A232990 for another version.
Cf. A057354 (partial sums, without initial zeros).
Sequence in context: A127829 A127831 A164364 * A105385 A190227 A090626
KEYWORD
nonn,easy
AUTHOR
Bruno Berselli, Oct 27 2011
STATUS
approved