A053796 a(n) = (n^2+n) modulo 5.
0, 2, 1, 2, 0, 0, 2, 1, 2, 0, 0, 2, 1, 2, 0, 0, 2, 1, 2, 0, 0, 2, 1, 2, 0, 0, 2, 1, 2, 0, 0, 2, 1, 2, 0, 0, 2, 1, 2, 0, 0, 2, 1, 2, 0, 0, 2, 1, 2, 0, 0, 2, 1, 2, 0, 0, 2, 1, 2, 0, 0, 2, 1, 2, 0, 0, 2, 1, 2, 0, 0, 2, 1, 2, 0, 0, 2, 1, 2, 0, 0, 2, 1, 2, 0, 0, 2, 1, 2, 0, 0, 2, 1, 2, 0, 0, 2, 1, 2, 0, 0, 2, 1, 2, 0
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,1).
Crossrefs
Cf. A053793.
Programs
-
Magma
[(n^2+n) mod 5 : n in [0..100]]; // Wesley Ivan Hurt, Apr 20 2021
-
Mathematica
Table[Mod[n^2+n,5],{n,0,110}] (* or *) PadRight[{},120,{0,2,1,2,0}] (* Harvey P. Dale, Sep 12 2017 *)
Formula
From Bruno Berselli, Dec 02 2010: (Start)
G.f.: x*(2+x+2*x^2)/(1-x^5);
a(n) = a(n-5) for n > 4. (End)
Extensions
More terms from James Sellers, Apr 08 2000