OFFSET
0,1
COMMENTS
Numbers represented as 212 in number base n including binary with digits larger than 1: 212_2 = 12 and ternary 212_3 = 23. - Ron Knott, Nov 14 2017
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..5000
Index entries for linear recurrences with constant coefficients, signature (3,-3,1).
FORMULA
a(n) = 2*n^2 + n + 2. - N. J. A. Sloane, Nov 10 2009
a(n) = 4*n + a(n-1) - 1 (with a(0)=2). - Vincenzo Librandi, Nov 16 2010
From Colin Barker, Oct 03 2012: (Start)
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3).
G.f.: (2 - x + 3*x^2)/(1-x)^3. (End)
E.g.f.: (2*x^2 + 3*x +2)*exp(x). - G. C. Greubel, Jul 16 2017
EXAMPLE
1 + 0 + 4 = 5, 2 + 1 + 9 = 12, 3 + 4 + 16 = 23, ...
MAPLE
MATHEMATICA
f[n_]:=(n*(2*n+1)+2); Table[f[n], {n, 5!}] (* Vladimir Joseph Stephan Orlovsky, Feb 07 2010 *)
LinearRecurrence[{3, -3, 1}, {2, 5, 12}, 50] (* Harvey P. Dale, Mar 15 2015 *)
PROG
(PARI) a(n)=n+(n-1)^2+(n+1)^2 \\ Charles R Greathouse IV, Oct 07 2015
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Odimar Fabeny, Aug 04 2004
STATUS
approved