|
|
A131743
|
|
Period 4: repeat [0, 1, 0, 2].
|
|
7
|
|
|
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
|
|
|
FORMULA
|
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
|
|
MAPLE
|
|
|
MATHEMATICA
|
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
|
(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
(Python)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|