[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
login
Expansion of (x + x^2 + x^3) / (1 - x + x^2 - x^3 + x^4) in powers of x.
2

%I #22 Sep 08 2022 08:46:10

%S 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,-2,-2,

%T -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,-2,

%U -2,-1,0,1,2,2,1,0,-1,-2,-2,-1,0,1,2,2,1,0,-1

%N Expansion of (x + x^2 + x^3) / (1 - x + x^2 - x^3 + x^4) in powers of x.

%C Cycle period is 10. - _Robert G. Wilson v_, Aug 02 2018

%H G. C. Greubel, <a href="/A253262/b253262.txt">Table of n, a(n) for n = 0..2500</a>

%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (1,-1,1,-1).

%F Euler transform of length 10 sequence [2, -1, -1, 0, -1, 0, 0, 0, 0, 1].

%F G.f.: x * (1 + x) * (1 - x^3) / ((1 - x) * (1 + x^5)).

%F INVERT transform is A003476.

%F a(n) = -a(-n) = -a(n+5) for all n in Z.

%F a(n) = f(n) / f(1) where f(n) := tan( am( n*x, m)) where x = 0.7379409146... and m = 1.3481185591... and am() is the Jacobi amplitude function.

%e G.f. = x + 2*x^2 + 2*x^3 + x^4 - x^6 - 2*x^7 - 2*x^8 - x^9 + x^11 + 2*x^12 + ...

%t a[ n_] := {1, 2, 2, 1, 0}[[Mod[n, 5, 1]]] (-1)^Quotient[n, 5];

%t CoefficientList[Series[x*(1+x)*(1-x^3)/((1-x)*(1+x^5)), {x,0,60}], x] (* _G. C. Greubel_, Aug 02 2018 *)

%t CoefficientList[ Series[x (x^2 + x + 1)/(x^4 - x^3 + x^2 - x + 1), {x, 0, 75}], x] (* or *)

%t LinearRecurrence[{1, -1, 1, -1}, {0, 1, 2, 2}, 75] (* _Robert G. Wilson v_, Aug 02 2018 *)

%o (PARI) {a(n) = [0, 1, 2, 2, 1][n%5 + 1] * (-1)^(n\5)};

%o (PARI) x='x+O('x^60); concat([0], Vec(x*(1+x)*(1-x^3)/((1-x)*(1+x^5)))) \\ _G. C. Greubel_, Aug 02 2018

%o (Magma) m:=60; R<x>:=PowerSeriesRing(Integers(), m); [0] cat Coefficients(R!(x*(1+x)*(1-x^3)/((1-x)*(1+x^5)))); // _G. C. Greubel_, Aug 02 2018

%Y Cf. A003476.

%K sign,easy

%O 0,3

%A _Michael Somos_, Apr 30 2015