%I #22 Nov 24 2023 12:42:41
%S 1,3,11,41,149,527,1823,6197,20777,68891,226355,738113,2391485,
%T 7705895,24712007,78918989,251105873,796364339,2518233179,7942120025,
%U 24988621541,78452649023,245818300271,768835960421,2400651060089
%N a(n) = n*3^(n-1) + (3^n + 1)/2.
%C Binomial transform of A057711 (without leading zero). Second binomial transform of (1,1,3,3,5,5,7,7,9,9,11,11,...).
%H Vincenzo Librandi, <a href="/A086972/b086972.txt">Table of n, a(n) for n = 0..400</a>
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (7,-15,9).
%F a(n) = (1/2)*(A081038(n) + 1).
%F G.f.: (1-4*x+5*x^2)/((1-x)*(1-3*x)^2).
%F a(n) = A027471(n) + A007051(n).
%F E.g.f.: (1/2)*( exp(x) + (2*x+1)*exp(3*x) ). - _G. C. Greubel_, Nov 24 2023
%t Table[((2*n+3)*3^(n-1) +1)/2, {n,0,30}] (* _G. C. Greubel_, Nov 24 2023 *)
%o (Magma) [n*3^(n-1) + (3^n+1)/2: n in [0..30]]; // _Vincenzo Librandi_, Jun 09 2011
%o (PARI) Vec((1-4*x+5*x^2)/((1-x)*(1-3*x)^2) + O(x^40)) \\ _Michel Marcus_, Mar 08 2016
%o (SageMath) [((2*n+3)*3^(n-1) +1)//2 for n in range(31)] # _G. C. Greubel_, Nov 24 2023
%Y Cf. A007051, A027471, A057711, A081038.
%Y Partial sums of A199923.
%K easy,nonn
%O 0,2
%A _Paul Barry_, Jul 26 2003