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 A138188 #19 Sep 08 2022 08:45:33 %S A138188 1,-3,0,3,-5,0,5,-7,0,7,-9,0,9,-11,0,11,-13,0,13,-15,0,15,-17,0,17, %T A138188 -19,0,19,-21,0,21,-23,0,23,-25,0,25,-27,0,27,-29,0,29,-31,0,31,-33,0, %U A138188 33,-35,0,35,-37,0,37,-39,0,39,-41,0,41 %N A138188 Expansion of (1 - 2*x - 2*x^2 - x^3)/(1 + x + x^2 - x^3 - x^4 - x^5). %C A138188 Partial sums of A138187. %C A138188 Partial sums are A138189. %H A138188 G. C. Greubel, <a href="/A138188/b138188.txt">Table of n, a(n) for n = 0..1000</a> %H A138188 <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (-1,-1,1,1,1). %F A138188 a(n) = 2*floor(n/3) + 1 if (n mod 3) = 0, -(2*floor(n/3) + 3) if (n mod 3) = 1 and 0 if (n mod 3) = 2. - _G. C. Greubel_, Jun 16 2021 %F A138188 a(n) = (2*floor((n+5)/3)-1)*sign((n + 1) mod 3)*(-1)^(n mod 3). - _Wesley Ivan Hurt_, Jan 02 2022 %t A138188 a[n_]:= a[n]= If[Mod[n, 3]==0, 2*Floor[n/3] +1, If[Mod[n, 3]==1, -(2*Floor[n/3] +3), 0]]; Table[a[n], {n, 0, 100}] (* _G. C. Greubel_, Jun 16 2021 *) %o A138188 (Magma) R<x>:=PowerSeriesRing(Integers(), 100); Coefficients(R!( (1-2*x-2*x^2-x^3)/(1+x+x^2-x^3-x^4-x^5) )); // _G. C. Greubel_, Jun 16 2021 %o A138188 (Sage) %o A138188 def A138188(n): %o A138188 if (n%3==0): return 2*(n//3) +1 %o A138188 elif (n%3==1): return -(2*(n//3) +3) %o A138188 else: return 0 %o A138188 [A138188(n) for n in (0..100)] # _G. C. Greubel_, Jun 16 2021 %Y A138188 Cf. A138187, A138189. %K A138188 easy,sign %O A138188 0,2 %A A138188 _Paul Barry_, Mar 04 2008