OFFSET
0,2
COMMENTS
Apart from 0, partial sums of the numbers of the form 6*2^m + m + 3.
After a(5) = 211 and a(17) = 786613, the third prime number is a(557), which has 169 digits.
LINKS
Bruno Berselli, Table of n, a(n) for n = 0..1000
L. B. W. Jolley, Summation of Series, Dover, 1961, p. 12 (series n. 64).
Index entries for linear recurrences with constant coefficients, signature (5,-9,7,-2).
FORMULA
G.f.: x*(9 - 20*x + 10*x^2)/((1 - 2*x)*(1 - x)^3).
a(n) = 5*a(n-1) - 9*a(n-2) + 7*a(n-3) - 2*a(n-4).
MATHEMATICA
Table[(3 2^(n + 2) + n (n + 5))/2 - 6, {n, 0, 40}]
CoefficientList[Series[x (9 - 20 x + 10 x^2)/((1 - 2 x) (1 - x)^3), {x, 0, 40}], x] (* Vincenzo Librandi, Mar 29 2014 *)
LinearRecurrence[{5, -9, 7, -2}, {0, 9, 25, 54}, 40] (* Harvey P. Dale, Sep 22 2018 *)
PROG
(Sage) [(3*2^(n+2)+n*(n+5))/2-6 for n in (0..40)]
(Magma) [(3*2^(n+2)+n*(n+5))/2-6: n in [0..40]];
(Magma) I:=[0, 9, 25, 54]; [n le 4 select I[n] else 5*Self(n-1)-9*Self(n-2)+7*Self(n-3)-2*Self(n-4): n in [1..35]]; // Vincenzo Librandi, Mar 29 2014
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Bruno Berselli, Mar 28 2014
STATUS
approved