login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


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

0,3

COMMENTS

This sequence can be continued periodically for negative values of n.

See a comment on A203571 where a k-family of 2k-periodic sequences P_k has been defined. The present sequence is P_4. - Wolfdieter Lang, Feb 02 2012

LINKS

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

Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,0,0,1).

FORMULA

a(n) = n mod 4 if (-1)^floor(n/4)=+1, otherwise (4-n) mod 4, n >= 0. (-1)^floor(n/4) is the parity of the quotient floor(n/4). This quotient is sometimes denoted by n\4.

O.g.f.: x*(1+2*x+3*x^2+3*x^4+2*x^5+x^6)/( (1-x)*(1+x)*(1+x^2)*(1+x^4)).

a(n) = floor(410107/33333333*10^(n+1)) mod 10. - Hieronymus Fischer, Jan 04 2013

a(n) = floor(2323/21845*4^(n+1)) mod 4. - Hieronymus Fischer, Jan 04 2013

EXAMPLE

a(10) = 10(mod 4) = 2 because 10\4 = floor(10/4)=2 is even; the parity is +1.

a(7) = (4-7)(mod 4) = 1 because 7\4 = floor(7/4)=1 is odd; the parity is -1.

MATHEMATICA

PadRight[{}, 120, {0, 1, 2, 3, 0, 3, 2, 1}] (* Vincenzo Librandi, Oct 17 2018 *)

PROG

(PARI) a(n)=[0, 1, 2, 3, 0, 3, 2, 1][n%8+1] \\ Charles R Greathouse IV, Oct 16 2015

(MAGMA) &cat [[0, 1, 2, 3, 0, 3, 2, 1]^^15]; // Vincenzo Librandi, Oct 17 2018

CROSSREFS

Cf. A193680 (mod 3 case).

Cf: A203571.

Sequence in context: A316590 A080593 A319148 * A051933 A234963 A131900

Adjacent sequences:  A193679 A193680 A193681 * A193683 A193684 A193685

KEYWORD

nonn,easy

AUTHOR

Wolfdieter Lang, Sep 30 2011

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified February 16 21:46 EST 2020. Contains 331975 sequences. (Running on oeis4.)