This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A131743 #49 Dec 12 2023 09:26:14 %S A131743 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, %T A131743 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, %U A131743 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 %N A131743 Period 4: repeat [0, 1, 0, 2]. %C A131743 Least positive integer k such that n^k == 1 (mod 4), or 0 if GCD(n,4) > 1. - _Bruno Berselli_, Mar 22 2016 %H A131743 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,1). %F A131743 G.f.: x*(1+2*x^2)/ ((1-x)*(x+1)*(x^2+1)). - _R. J. Mathar_, Nov 15 2007 %F A131743 a(n) = 3/4-1/2*sin(1/2*Pi*n)+3/4*(-1)^(1+n). - _R. J. Mathar_, Nov 15 2007 %F A131743 a(n) = Fibonacci(2*n) mod 3. - _Gary Detlefs_ Feb 13 2011 %F A131743 a(n) == A006368(n) (mod 3). - _Philippe Deléham_, Oct 24 2011 %F A131743 a(n) = a(n-4) for n>3. - _Wesley Ivan Hurt_, Jul 09 2016 %p A131743 seq(op([0, 1, 0, 2]), n=0..50); # _Wesley Ivan Hurt_, Jul 09 2016 %t A131743 PadRight[{}, 106, {0, 1, 0, 2}] (* _Harvey P. Dale_, Apr 06 2012 *) %t A131743 CoefficientList[Series[x (1 + 2 x^2)/((1 - x) (x + 1) (x^2 + 1)), {x, 0, 120}], x] (* _Michael De Vlieger_, Jul 09 2016 *) %o A131743 (Magma) &cat [[0, 1, 0, 2]^^30]; // _Bruno Berselli_, Mar 22 2016 %o A131743 (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 %o A131743 (PARI) a(n)=n%2*(n%4+1)/2 \\ _Charles R Greathouse IV_, Mar 22 2016 %o A131743 (Python) %o A131743 def A131743(n): return (0,1,0,2)[n&3] # _Chai Wah Wu_, Jul 29 2023 %Y A131743 Cf. A006368. %K A131743 nonn,easy %O A131743 0,4 %A A131743 _Paul Curtz_, Sep 20 2007