_Asher Auel (asher.auel(AT)reed.edu), _, Dec 14 1999
_Asher Auel (asher.auel(AT)reed.edu), _, Dec 14 1999
reviewed
approved
proposed
reviewed
editing
proposed
<a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (3,-2).
E.g.f.: (1 - 8*exp(x) + 9*exp(2*x))/2. - Stefano Spezia, Sep 28 2022
Cf. A048491.
approved
editing
(MAGMAMagma) I:=[5, 14]; [1] cat [n le 2 select I[n] else 3*Self(n-1) - 2*Self(n-2): n in [1..30]]; // G. C. Greubel, Sep 03 2018
(MAGMAMagma) R<x>:=PowerSeriesRing(Integers(), 30); Coefficients(R!( (1+x)^2)/((1-x)*(1-2*x))); // Marius A. Burtea, Oct 15 2019
reviewed
approved
proposed
reviewed
editing
proposed
(JavaScript)
function sumArray(arr, k) {
t = 0;
for (j = 0; j <= k; j++) t += arr[j];
return t;
}
a = new Array();
a[0] = 1;
for (i = 1; i < 50; i++) a[i] = 4 * i + sumArray(a, i - 1);
document.write(a + "<br>"); // Jon Perry, Nov 20 2012
proposed
editing