|
|
A131743
|
|
Period 4: repeat [0, 1, 0, 2].
|
|
5
|
|
|
0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 0
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,4
|
|
COMMENTS
|
Least positive integer k such that n^k == 1 (mod 4), or 0 if GCD(n,4) > 1. - Bruno Berselli, Mar 22 2016
|
|
LINKS
|
Table of n, a(n) for n=0..104.
Index entries for linear recurrences with constant coefficients, signature (0,0,0,1).
|
|
FORMULA
|
a(n) = (1/8)*(5*(n mod 4)-3*((n+1) mod 4)+3*((n+2) mod 4)-((n+3) mod 4)). - Paolo P. Lava, Oct 02 2007
G.f.: x*(1+2*x^2)/ ((1-x)*(x+1)*(x^2+1)). - R. J. Mathar, Nov 15 2007
a(n) = 3/4-1/2*sin(1/2*Pi*n)+3/4*(-1)^(1+n). - R. J. Mathar, Nov 15 2007
a(n) = (1-(-1)^n)*(3+I^(n+1))/4. - Paolo P. Lava, Jul 17 2008, Bruno Berselli, Mar 14 2011
a(n) = Fibonacci(2*n) mod 3. - Gary Detlefs Feb 13 2011
a(n) == A006368(n) (mod 3). - Philippe Deléham, Oct 24 2011
a(n) = a(n-4) for n>3. - Wesley Ivan Hurt, Jul 09 2016
|
|
MAPLE
|
seq(op([0, 1, 0, 2]), n=0..50); # Wesley Ivan Hurt, Jul 09 2016
|
|
MATHEMATICA
|
PadRight[{}, 106, {0, 1, 0, 2}] (* Harvey P. Dale, Apr 06 2012 *)
CoefficientList[Series[x (1 + 2 x^2)/((1 - x) (x + 1) (x^2 + 1)), {x, 0, 120}], x] (* Michael De Vlieger, Jul 09 2016 *)
|
|
PROG
|
(MAGMA) &cat [[0, 1, 0, 2]^^30]; // Bruno Berselli, Mar 22 2016
(PARI) x='x+O('x^200); concat(0, Vec(-x*(1+2*x^2)/((x-1)*(x+1)*(x^2+1)))) \\ Altug Alkan, Mar 22 2016
(PARI) a(n)=n%2*(n%4+1)/2 \\ Charles R Greathouse IV, Mar 22 2016
|
|
CROSSREFS
|
Cf. A006368.
Sequence in context: A194591 A070105 A111397 * A147648 A113686 A193403
Adjacent sequences: A131740 A131741 A131742 * A131744 A131745 A131746
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
Paul Curtz, Sep 20 2007
|
|
STATUS
|
approved
|
|
|
|