login
a(n) = (n^2+n) modulo 5.
2

%I #22 Dec 30 2023 23:49:13

%S 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,

%T 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,

%U 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

%N a(n) = (n^2+n) modulo 5.

%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,0,1).

%F From _Bruno Berselli_, Dec 02 2010: (Start)

%F G.f.: x*(2+x+2*x^2)/(1-x^5);

%F a(n) = a(n-5) for n > 4. (End)

%t Table[Mod[n^2+n,5],{n,0,110}] (* or *) PadRight[{},120,{0,2,1,2,0}] (* _Harvey P. Dale_, Sep 12 2017 *)

%o (Magma) [(n^2+n) mod 5 : n in [0..100]]; // _Wesley Ivan Hurt_, Apr 20 2021

%Y Cf. A053793.

%K nonn,easy

%O 0,2

%A Stuart M. Ellerstein (ellerstein(AT)aol.com), Mar 27 2000

%E More terms from _James A. Sellers_, Apr 08 2000