A070431 a(n) = n^2 mod 6.
0, 1, 4, 3, 4, 1, 0, 1, 4, 3, 4, 1, 0, 1, 4, 3, 4, 1, 0, 1, 4, 3, 4, 1, 0, 1, 4, 3, 4, 1, 0, 1, 4, 3, 4, 1, 0, 1, 4, 3, 4, 1, 0, 1, 4, 3, 4, 1, 0, 1, 4, 3, 4, 1, 0, 1, 4, 3, 4, 1, 0, 1, 4, 3, 4, 1, 0, 1, 4, 3, 4, 1, 0, 1, 4, 3, 4, 1, 0, 1, 4, 3, 4, 1, 0, 1, 4, 3, 4, 1, 0, 1, 4, 3, 4, 1, 0, 1, 4, 3, 4
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (0, 0, 0, 0, 0, 1).
Programs
-
Magma
[n^2 mod 6 : n in [0..100]]; // Wesley Ivan Hurt, Apr 01 2016
-
Magma
[Modexp(n, 2, 6): n in [0..100]]; // Vincenzo Librandi, Apr 02 2016
-
Maple
A070431:=n->n^2 mod 6: seq(A070431(n), n=0..100); # Wesley Ivan Hurt, Apr 01 2016
-
Mathematica
Table[Mod[n^2, 6], {n, 0, 200}] (* Vladimir Joseph Stephan Orlovsky, Apr 21 2011 *) LinearRecurrence[{0, 0, 0, 0, 0, 1},{0, 1, 4, 3, 4, 1},101] (* Ray Chandler, Aug 26 2015 *) PowerMod[Range[0,120],2,6] (* or *) PadRight[{},120,{0,1,4,3,4,1}] (* Harvey P. Dale, Aug 11 2019 *)
-
PARI
a(n)=n^2%6 \\ Charles R Greathouse IV, Sep 24 2015
-
Sage
[power_mod(n,2,6) for n in range(0, 101)] # Zerinvary Lajos, Oct 30 2009
Formula
G.f.: -x*(1+4*x+3*x^2+4*x^3+x^4)/((x-1)*(1+x)*(1+x+x^2)*(x^2-x+1)). - R. J. Mathar, Jul 23 2009
a(n) = a(n-6). - Reinhard Zumkeller, Apr 24 2009
From G. C. Greubel, Apr 01 2016: (Start)
a(6*m) = 0.
a(2*n) = 4*A011655(n).
a(n) = (1/6)*(13 + 3*(-1)^n - 12*cos(n*Pi/3) - 4*cos(2*n*Pi/3)).
G.f.: (x +4*x^2 +3*x^3 + 4*x^4 +x^5)/(1 - x^6). (End)
Comments