%I #30 Mar 15 2024 15:20:19
%S 1,4,14,45,139,422,1272,3823,11477,34440,103330,310001,930015,2790058,
%T 8370188,25110579,75331753,225995276,677985846,2033957557,6101872691,
%U 18305618094,54916854304,164750562935,494251688829,1482755066512
%N Expansion of g.f. (1 - x + x^2)/((1-3*x)*(x-1)^2).
%C Superseeker suggests a(n+2) - 2*a(n+1) + a(n) = 7*3^n = A005032(n).
%C Inverse binomial transform gives match with first differences of A026622.
%C Floretion Algebra Multiplication Program, FAMP Code: kbasefor[(- 'j + 'k - 'ii' - 'ij' - 'ik')], vesfor = A000004, Fortype: 1A, Roktype (leftfactor) is set to:Y[sqa.Findk()] = Y[sqa.Findk()] + Math.signum(Y[sqa.Findk()])*p (internal program code)
%H Harvey P. Dale, <a href="/A108765/b108765.txt">Table of n, a(n) for n = 0..1000</a>
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (5,-7,3).
%F From _Rolf Pleisch_, Feb 10 2008: (Start)
%F a(0) = 1; a(n) = 3*a(n-1) + n.
%F a(n) = (7*3^n - 2*n - 3)/4. (End)
%F a(0)=1, a(1)=4, a(2)=14, a(n) = 5*a(n-1) - 7*a(n-2) + 3*a(n-3). - _Harvey P. Dale_, Dec 11 2012
%t s=1;lst={s};Do[s+=(s+(n+=s));AppendTo[lst, s], {n, 5!}];lst (* _Vladimir Joseph Stephan Orlovsky_, Oct 11 2008 *)
%t CoefficientList[Series[(1-x+x^2)/((1-3x)(x-1)^2),{x,0,40}],x] (* or *) LinearRecurrence[{5,-7,3},{1,4,14},40] (* _Harvey P. Dale_, Dec 11 2012 *)
%Y Cf. A005032, A026622.
%K easy,nonn
%O 0,2
%A _Creighton Dement_, Jun 24 2005