login
a(n) = 3^n + 1 - 0^n.
3

%I #34 Jul 22 2024 04:37:36

%S 1,4,10,28,82,244,730,2188,6562,19684,59050,177148,531442,1594324,

%T 4782970,14348908,43046722,129140164,387420490,1162261468,3486784402,

%U 10460353204,31381059610,94143178828,282429536482,847288609444

%N a(n) = 3^n + 1 - 0^n.

%H Patrick De Geest, <a href="http://www.worldofnumbers.com/index.html">World!Of Numbers</a>

%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (4,-3).

%F G.f.: (1-3*x^2)/((1-x)*(1-3*x)).

%F a(n) = Sum_{k=0..n} binomial(n, k)*0^(k(n-k))*3^k.

%F From _R. J. Mathar_, Aug 04 2008: (Start)

%F a(n) = A034472(n), n>0.

%F a(n) = A094388(n-1), n>1.

%F a(n+1) - a(n) = A110593(n+1). (End)

%F a(n) = 3*a(n-1) - 2, with a(1)=4. - _Vincenzo Librandi_, Dec 29 2010

%F From _J. Conrad_, Nov 25 2015: (Start)

%F For n>0, a(n) = 2 * (A011782(0) + A011782(n) + Sum_{x=1..n-1} Sum_{k=0..x-1}(binomial(x-1,k)*(A011782(k+1) + A011782(n-x+k)))).

%F Alternatively, for n>0, a(n) = A027649(n) - 2 * Sum_{x=1..n-1}Sum_{k=0..x-1}(binomial(x-1,k)*(A011782(k+1) + A011782(n-x+k))). (End)

%F E.g.f.: -1 + exp(x) + exp(3*x). - _G. C. Greubel_, Jun 22 2021

%t Join[{1},LinearRecurrence[{4,-3},{4,10},30]] (* _Harvey P. Dale_, Mar 29 2015 *)

%o (PARI) my(x='x+O('x^50)); Vec((1-3*x^2)/((1-x)*(1-3*x))) \\ _Altug Alkan_, Dec 04 2015

%o (Magma) [1] cat [3^n + 1: n in [1..30]]; // _G. C. Greubel_, Jun 22 2021

%o (Sage) [1]+[3^n + 1 for n in (1..30)] # _G. C. Greubel_, Jun 22 2021

%Y Cf. A011782, A027649, A034472, A094388, A110593.

%K easy,nonn

%O 0,2

%A _Paul Barry_, Feb 07 2005