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 A112030 #30 Jan 31 2023 16:10:01 %S A112030 3,1,-3,-1,3,1,-3,-1,3,1,-3,-1,3,1,-3,-1,3,1,-3,-1,3,1,-3,-1,3,1,-3, %T A112030 -1,3,1,-3,-1,3,1,-3,-1,3,1,-3,-1,3,1,-3,-1,3,1,-3,-1,3,1,-3,-1,3,1, %U A112030 -3,-1,3,1,-3,-1,3,1,-3,-1,3,1,-3,-1,3,1,-3,-1,3,1,-3,-1,3,1 %N A112030 a(n) = (2 + (-1)^n) * (-1)^floor(n/2). %C A112030 The fractions A112031(n)/A112032(n) give the partial sums of a(n)/floor((n+4)/2). %C A112030 Sum of the two Cartesian coordinates from the image of the point (2,1) after n 90-degree counterclockwise rotations about the origin. - _Wesley Ivan Hurt_, Jul 06 2013 %H A112030 <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (0,-1). %F A112030 a(n) = A010684(n+1) * (-1)^floor(n/2). %F A112030 O.g.f.: (3+x)/(1+x^2). - _R. J. Mathar_, Jan 09 2008 %p A112030 A112030 := proc(n) %p A112030 (2 + (-1)^n) * (-1)^floor(n/2) ; %p A112030 end proc: # _R. J. Mathar_, Jul 09 2013 %t A112030 LinearRecurrence[{0, -1}, {3, 1}, 100] (* _Jean-François Alcover_, Nov 24 2020 *) %o A112030 (PARI) a(n)=[3,1,-3,-1][n%4+1] \\ _Charles R Greathouse IV_, Aug 21 2011 %o A112030 (Python) %o A112030 def A112030(n): return (3, 1, -3, -1)[n&3] # _Chai Wah Wu_, Jan 31 2023 %Y A112030 Cf. A010684, A016116, A112031, A112032, A112033. %K A112030 sign,easy %O A112030 0,1 %A A112030 _Reinhard Zumkeller_, Aug 27 2005