%I
%S 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,
%T 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,
%U 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
%N a(n) = n^2 mod 6.
%C a(m*n) = a(m)*a(n) mod 6; a(3*n+k) = a(3*nk) for k <= 3*n.  _Reinhard Zumkeller_, Apr 24 2009
%C Equivalently n^6 mod 6.  _Zerinvary Lajos_, Nov 06 2009
%C Equivalently: n^(2*m + 2) mod 6; n^4 mod 6 is A070511; See formulas in A070511.  _G. C. Greubel_, Apr 01 2016
%H <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (0, 0, 0, 0, 0, 1).
%F G.f.: x*(1+4*x+3*x^2+4*x^3+x^4)/((x1)*(1+x)*(1+x+x^2)*(x^2x+1)).  _R. J. Mathar_, Jul 23 2009
%F a(n) = a(n6).  _Reinhard Zumkeller_, Apr 24 2009
%p A070431:=n>n^2 mod 6: seq(A070431(n), n=0..100); # _Wesley Ivan Hurt_, Apr 01 2016
%t Table[Mod[n^2, 6], {n, 0, 200}] (* _Vladimir Joseph Stephan Orlovsky_, Apr 21 2011 *)
%t LinearRecurrence[{0, 0, 0, 0, 0, 1},{0, 1, 4, 3, 4, 1},101] (* _Ray Chandler_, Aug 26 2015 *)
%o (Sage) [power_mod(n,2,6) for n in xrange(0, 101)] # _Zerinvary Lajos_, Oct 30 2009
%o (Sage) [power_mod(n,6,6) for n in xrange(0, 101)] # _Zerinvary Lajos_, Nov 06 2009
%o (PARI) a(n)=n^2%6 \\ _Charles R Greathouse IV_, Sep 24 2015
%o (MAGMA) [n^2 mod 6 : n in [0..100]]; // _Wesley Ivan Hurt_, Apr 01 2016
%o (MAGMA) [Modexp(n, 2, 6): n in [0..100]]; // _Vincenzo Librandi_, Apr 02 2016
%Y Cf. A000290, A008959, A070435, A070438, A070442, A070452, A070511, A159852.
%K nonn,easy
%O 0,3
%A _N. J. A. Sloane_, May 12 2002
