OFFSET
0,2
COMMENTS
In general, the ordinary generating function for the values of quadratic polynomial p*n^2 + q*n + k, is (k + (p + q - 2*k)*x + (p - q + k)*x^2)/(1 - x)^3.
From Bruno Berselli, Mar 25 2016: (Start)
This sequence and A140676 provide all integer m such that 3*m + 4 is a square.
After -1, second bisection of A184005. (End)
LINKS
Ilya Gutkovskiy, Examples of the ordinary generating function for the values of quadratic polynomial.
Leo Tavares, Triple Diamond Illustration.
Eric Weisstein's World of Mathematics, Quadratic Polynomial.
Index entries for linear recurrences with constant coefficients, signature (3,-3,1).
FORMULA
G.f.: (-1 + 7*x)/(1 - x)^3.
E.g.f.: exp(x)*(-1 + 5*x + 3*x^2).
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3).
Sum_{n>=0} 1/a(n) = 3*(log(3) - 2)/8 - Pi/(8*sqrt(3)) = -0.564745312278736...
a(n) = Sum_{i = n-1..2*n-1} (2*i + 1). - Bruno Berselli, Feb 16 2018
Sum_{n>=0} (-1)^(n+1)/a(n) = Pi/(4*sqrt(3)) + 3/4. - Amiram Eldar, Jul 20 2023
EXAMPLE
a(0) = 3*0^2 + 2*0 - 1 = -1;
a(1) = 3*1^2 + 2*1 - 1 = 4;
a(2) = 3*2^2 + 2*2 - 1 = 15;
a(3) = 3*3^2 + 2*3 - 1 = 32, etc.
MATHEMATICA
Table[3 n^2 + 2 n - 1, {n, 0, 50}]
LinearRecurrence[{3, -3, 1}, {-1, 4, 15}, 51]
PROG
(PARI) Vec((-1 + 7*x)/(1 - x)^3 + O(x^60)) \\ Michel Marcus, Mar 22 2016
(PARI) lista(nn) = {for(n=0, nn, print1(3*n^2 + 2*n - 1, ", ")); } \\ Altug Alkan, Mar 25 2016
(PARI) vector(50, n, n--; 3*n^2+2*n-1) \\ Bruno Berselli, Mar 25 2016
(Sage) [3*n^2+2*n-1 for n in (0..50)] # Bruno Berselli, Mar 25 2016
(Maxima) makelist(3*n^2+2*n-1, n, 0, 50); /* Bruno Berselli, Mar 25 2016 */
(Magma) [3*n^2+2*n-1: n in [0..50]]; // Bruno Berselli, Mar 25 2016
(GAP) List([0..50], n -> 3*n^2+2*n-1); # Bruno Berselli, Feb 16 2018
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Ilya Gutkovskiy, Mar 22 2016
STATUS
approved