OFFSET
0,3
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..10000
Seppo Mustonen, On lines and their intersection points in a rectangular grid of points [Local copy]
Index entries for linear recurrences with constant coefficients, signature (3,-3,1).
FORMULA
a(n) = n^2 + 2 = A059100(n) for n > 1.
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n > 4. - Colin Barker, May 24 2015
G.f.: -x*(2*x^3 - 4*x^2 + 3*x + 1) / (x-1)^3. - Colin Barker, May 24 2015
Sum_{n>=1} 1/a(n) = Pi * coth(sqrt(2)*Pi) / 2^(3/2) - 1/4. - Vaclav Kotesovec, May 01 2018
MATHEMATICA
a[n_]:=If[n<2, n, n^2+2] Table[a[n], {n, 0, 50}]
Join[{0, 1}, Range[2, 50]^2+2] (* Harvey P. Dale, Feb 06 2015 *)
PROG
(PARI) Vec(-x*(2*x^3-4*x^2+3*x+1) / (x-1)^3 + O(x^100)) \\ Colin Barker, May 24 2015
(Magma) [0, 1] cat [n^2 + 2: n in [2..100]]; // G. C. Greubel, Apr 30 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Seppo Mustonen, May 28 2009
STATUS
approved