login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A070431 a(n) = n^2 mod 6. 20
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
a(m*n) = a(m)*a(n) mod 6; a(3*n+k) = a(3*n-k) for k <= 3*n. - Reinhard Zumkeller, Apr 24 2009
Equivalently n^6 mod 6. - Zerinvary Lajos, Nov 06 2009
Equivalently: n^(2*m + 4) mod 6; n^(2*m + 2) mod 6. - G. C. Greubel, Apr 01 2016
LINKS
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)
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 *)
PROG
(Sage) [power_mod(n, 2, 6) for n in range(0, 101)] # Zerinvary Lajos, Oct 30 2009
(PARI) a(n)=n^2%6 \\ Charles R Greathouse IV, Sep 24 2015
(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
CROSSREFS
Sequence in context: A329982 A243149 A048156 * A070511 A066340 A195597
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, May 12 2002
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 29 09:28 EDT 2024. Contains 371268 sequences. (Running on oeis4.)