login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A109718 Periodic sequence with period {0,1,0,3}, or n^3 mod 4. 1
0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0 (list; graph; refs; listen; history; internal format)
OFFSET

0,4

COMMENTS

Since n^(2k+1) mod 4 = n^3 mod 4 for k>1 this sequence also represents n^5 mod 4; and n^7 mod 4; etc

LINKS

Index to sequences with linear recurrences with constant coefficients, signature (0,0,0,1).

FORMULA

a(n) = n^3 mod 4. G.f. = (x+3x^3)/(1-x^4).

a(n) = (1/12)*{11*(n mod 4)-7*[(n+1) mod 4]+5*[(n+2) mod 4]-[(n+3) mod 4]} - Paolo P. Lava (paoloplava(AT)gmail.com), Nov 21 2006

a(n) = (n mod 2)*(n mod 4) = (1+(-1)^(n+1))*(2+i^(n+1))/2 with i=sqrt(-1).  - Bruno Berselli, Mar 14 2011

PROG

(Other) sage: [power_mod(n, 3, 4 )for n in xrange(0, 105)]# [From Zerinvary Lajos (zerinvarylajos(AT)yahoo.com), Oct 29 2009]

(MAGMA) &cat[[0, 1, 0, 3]: k in [0..26]];  // Bruno Berselli, Mar 14 2011

CROSSREFS

n mod 4 = A010873; n^2 mod 4 = A000035.

Cf. A110270; A131743.  - Bruno Berselli, Mar 14 2011

Sequence in context: A155522 A007524 A204689 * A053385 A035640 A079327

Adjacent sequences:  A109715 A109716 A109717 * A109719 A109720 A109721

KEYWORD

easy,nonn

AUTHOR

Bruce Corrigan (scentman(AT)myfamily.com), Aug 09 2005

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 17 16:35 EST 2012. Contains 206053 sequences.