%I #36 Nov 17 2017 01:18:50
%S 2,5,12,23,38,57,80,107,138,173,212,255,302,353,408,467,530,597,668,
%T 743,822,905,992,1083,1178,1277,1380,1487,1598,1713,1832,1955,2082,
%U 2213,2348,2487,2630,2777,2928,3083,3242,3405,3572,3743,3918,4097,4280,4467,4658
%N a(n) = n + (n-1)^2 + (n+1)^2.
%C 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
%H G. C. Greubel, <a href="/A096376/b096376.txt">Table of n, a(n) for n = 0..5000</a>
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (3,-3,1).
%F a(n) = 2*n^2 + n + 2. - _N. J. A. Sloane_, Nov 10 2009
%F a(n) = 4*n + a(n-1) - 1 (with a(0)=2). - _Vincenzo Librandi_, Nov 16 2010
%F From _Colin Barker_, Oct 03 2012: (Start)
%F a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3).
%F G.f.: (2 - x + 3*x^2)/(1-x)^3. (End)
%F E.g.f.: (2*x^2 + 3*x +2)*exp(x). - _G. C. Greubel_, Jul 16 2017
%e 1 + 0 + 4 = 5, 2 + 1 + 9 = 12, 3 + 4 + 16 = 23, ...
%p A096376:=n->n + (n-1)^2 + (n+1)^2: seq(A096376(n), n=0..100); # _Wesley Ivan Hurt_, Jul 16 2017
%t f[n_]:=(n*(2*n+1)+2);Table[f[n],{n,5!}] (* _Vladimir Joseph Stephan Orlovsky_, Feb 07 2010 *)
%t LinearRecurrence[{3,-3,1},{2,5,12},50] (* _Harvey P. Dale_, Mar 15 2015 *)
%o (PARI) a(n)=n+(n-1)^2+(n+1)^2 \\ _Charles R Greathouse IV_, Oct 07 2015
%K easy,nonn
%O 0,1
%A _Odimar Fabeny_, Aug 04 2004