%I #29 Apr 08 2022 18:05:07
%S 5,26,65,122,197,290,401,530,677,842,1025,1226,1445,1682,1937,2210,
%T 2501,2810,3137,3482,3845,4226,4625,5042,5477,5930,6401,6890,7397,
%U 7922,8465,9026,9605,10202,10817,11450
%N a(n) = 9*n^2 - 6*n + 2.
%C Group the set of natural numbers in set of 3 (1, 2, 3; 4, 5, 6; 7, 8, 9; ...) In each group, multiply the first two numbers and then add the third number to the result to get the corresponding entry in our sequence.
%H G. C. Greubel, <a href="/A185939/b185939.txt">Table of n, a(n) for n = 1..1000</a>
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (3,-3,1).
%F G.f. -x*(x+5)*(2*x+1) / (x-1)^3 . - _Alexander R. Povolotsky_, Feb 06 2011
%F a(n) = a(n-1) + 18*n - 15, a(1) = 5. - _Vincenzo Librandi_, Feb 07 2011
%F a(n) = (2*n-1)^2 + (2*n)^2 + (n-1)^2. - _Bruno Berselli_, Feb 06 2012
%F a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3). - _G. C. Greubel_, Feb 25 2017
%F E.g.f.: (9*x^2 + 3*x + 2)*exp(x) - 2. - _G. C. Greubel_, Jul 23 2017
%t CoefficientList[Series[-x*(x + 5)*(2*x + 1)/(x - 1)^3, {x,0,50}], x] (* or *) LinearRecurrence[{3, -3, 1}, {5, 26, 65}, 50] (* _G. C. Greubel_, Feb 25 2017 *)
%t Table[9n^2-6n+2,{n,40}] (* or *) #[[1]]#[[2]]+#[[3]]&/@Partition[Range[111],3] (* _Harvey P. Dale_, Apr 08 2022 *)
%o (PARI) x='x+O('x^50); Vec(-x*(x+5)*(2*x+1)/(x-1)^3) \\ _G. C. Greubel_, Feb 25 2017
%K nonn,easy
%O 1,1
%A _Amir H. Farrahi_, Feb 06 2011
|