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

 

Logo

Annual appeal: Please make a donation to keep the OEIS running! Over 6000 articles have referenced us, often saying "we discovered this result with the help of the OEIS".
Other ways to donate

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A070432 Period 4: repeat [0, 1, 4, 1]; a(n) = n^2 mod 8. 7
0, 1, 4, 1, 0, 1, 4, 1, 0, 1, 4, 1, 0, 1, 4, 1, 0, 1, 4, 1, 0, 1, 4, 1, 0, 1, 4, 1, 0, 1, 4, 1, 0, 1, 4, 1, 0, 1, 4, 1, 0, 1, 4, 1, 0, 1, 4, 1, 0, 1, 4, 1, 0, 1, 4, 1, 0, 1, 4, 1, 0, 1, 4, 1, 0, 1, 4, 1, 0, 1, 4, 1, 0, 1, 4, 1, 0, 1, 4, 1, 0, 1, 4, 1, 0, 1, 4, 1, 0, 1, 4, 1, 0, 1, 4, 1, 0, 1, 4, 1, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

COMMENTS

Multiplicative with a(2) = 4, a(2^e) = 0 if e >= 2, a(p^e) = 1 otherwise. - David W. Wilson, Jun 12 2005

LINKS

Table of n, a(n) for n=0..100.

Index entries for linear recurrences with constant coefficients, signature (0,0,0,1). - R. J. Mathar, Apr 20 2010

FORMULA

From R. J. Mathar, Apr 20 2010: (Start)

a(n) = a(n-4) for n > 3.

G.f.: -x*(1+4*x+x^2) / ( (x-1)*(1+x)*(x^2+1) ). (End)

From Paolo P. Lava, May 14 2010: (Start)

a(n) = (1/2)*((n mod 4) + 2*((n+1) mod 4) - ((n+2) mod 4)).

a(n) = (1/2)*(3 - 2*I^n + (-1)^n - 2*(-I)^n), I = sqrt(-1). (End)

Dirichlet g.f.: zeta(s)*(1 + 4*2^(-s))*(1 - 2^(-s)). - R. J. Mathar, Mar 10 2011

a(n) = (n mod 2) + 4*floor(((n+1) mod 4)/3). - Gary Detlefs, Dec 29 2011

From Wesley Ivan Hurt, Mar 19 2015: (Start)

a(n) = (((n+1) mod 4) - 1)^2.

a(n) = (1 + (-1)^n - 2(-1)^((2n + 1 - (-1)^n)/4))^2/4. (End)

E.g.f.: 2*cosh(x) + sinh(x) - 2*cos(x). - G. C. Greubel, Mar 22 2016

a(n) = (3 + cos(n*Pi) - 4*cos(n*Pi/2))/2. - Wesley Ivan Hurt, Dec 21 2016

a(n) = a(-n) for all n in Z. - Michael Somos, Dec 22 2016

EXAMPLE

G.f. = x + 4*x^2 + x^3 + x^5 + 4*x^6 + x^7 + x^9 + 4*x^10 + x^11 + x^13 + ...

MAPLE

seq(n mod 2 + 4*floor(((n+1) mod 4)/3), n = 0..200) # Gary Detlefs, Dec 29 2011

MATHEMATICA

Table[Mod[n^2, 8], {n, 0, 99}] (* Vladimir Joseph Stephan Orlovsky, Apr 21 2011 *)

Mod[Range[0, 99]^2, 8] (* Alonso del Arte, Mar 20 2015 *)

PROG

(PARI) a(n)=n^2%8 \\ Charles R Greathouse IV, Oct 07 2015

(MAGMA) &cat [[0, 1, 4, 1]^^30]; // Wesley Ivan Hurt, Dec 21 2016

CROSSREFS

Cf. A070430, A070431.

Sequence in context: A290459 A290458 A035253 * A170989 A290457 A253004

Adjacent sequences:  A070429 A070430 A070431 * A070433 A070434 A070435

KEYWORD

nonn,easy,mult

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 | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified November 18 05:25 EST 2017. Contains 294853 sequences.