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 A257145 #20 Sep 08 2022 08:46:12 %S A257145 1,-1,-2,2,1,0,-1,-2,2,1,0,-1,-2,2,1,0,-1,-2,2,1,0,-1,-2,2,1,0,-1,-2, %T A257145 2,1,0,-1,-2,2,1,0,-1,-2,2,1,0,-1,-2,2,1,0,-1,-2,2,1,0,-1,-2,2,1,0,-1, %U A257145 -2,2,1,0,-1,-2,2,1,0,-1,-2,2,1,0,-1,-2,2,1,0 %N A257145 a(n) = 5 * floor( (n+2) / 5) - n with a(0) = 1. %C A257145 Cycle period is 5, {0, -1, -2, 2, 1} after the first five terms. - _Robert G. Wilson v_, Aug 02 2018 %H A257145 G. C. Greubel, <a href="/A257145/b257145.txt">Table of n, a(n) for n = 0..2500</a> %H A257145 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (-1,-1,-1,-1). %F A257145 Euler transform of length 5 sequence [-1, -2, 0, 0, 1]. %F A257145 a(5*n) = 0 for all n in Z except n=0. %F A257145 a(n) = -a(-n) for all n in Z except n=0. %F A257145 a(n) = a(n+5) for all n in Z except n=-5 or n=0. %F A257145 Convolution inverse is A257143. %F A257145 G.f.: (1 - x) * (1 - x^2)^2 / (1 - x^5). %F A257145 G.f.: (1 - 2*x^2 + x^4) / (1 + x + x^2 + x^3 + x^4). %F A257145 a(n) = -A117444(n), n>0. - _R. J. Mathar_, Oct 05 2017 %e A257145 G.f. = 1 - x - 2*x^2 + 2*x^3 + x^4 - x^6 - 2*x^7 + 2*x^8 + x^9 - x^11 + ... %t A257145 a[ n_] := If[ n==0, 1, -Mod[ n, 5, -2]]; %t A257145 a[ n_] := If[ n==0, 1, Sign[n] SeriesCoefficient[ (1 - x) * (1 - x^2)^2 / (1 - x^5), {x, 0, Abs@n}]]; %t A257145 CoefficientList[Series[(1-x)*(1-x^2)^2/(1-x^5), {x,0,60}], x] (* _G. C. Greubel_, Aug 02 2018 *) %t A257145 a[n_] := 5 Floor[(n + 2)/5] - n; Array[a, 77, 0] (* or *) %t A257145 CoefficientList[ Series[(x - 1)^2 (x + 1)^2/(x^4 + x^3 + x^2 + x + 1), {x, 0, 76}], x] (* or *) %t A257145 LinearRecurrence[{-1, -1, -1, -1}, {1, -1, -2, 2, 1, 0}, 76] (* _Robert G. Wilson v_, Aug 02 2018*) %o A257145 (PARI) {a(n) = if( n==0, 1, (n+2) \ 5 * 5 - n)}; %o A257145 (PARI) {a(n) = if( n==0, 1, [0, -1, -2, 2, 1][n%5 + 1])}; %o A257145 (PARI) {a(n) = if( n==0, 1, sign(n) * polcoeff( (1 - x) * (1 - x^2)^2 / (1 - x^5) + x * O(x^abs(n)), abs(n)))}; %o A257145 (PARI) x='x+O('x^60); Vec((1-x)*(1-x^2)^2/(1-x^5)) \\ _G. C. Greubel_, Aug 02 2018 %o A257145 (Haskell) %o A257145 a257145 0 = 1 %o A257145 a257145 n = div (n + 2) 5 * 5 - n -- _Reinhard Zumkeller_, Apr 17 2015 %o A257145 (Magma) m:=60; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!((1-x)*(1-x^2)^2/(1-x^5))); // _G. C. Greubel_, Aug 02 2018 %Y A257145 Cf. A257143, A253262, A117444. %K A257145 sign,easy %O A257145 0,3 %A A257145 _Michael Somos_, Apr 16 2015