A024025 a(n) = 3^n - n^2.
1, 2, 5, 18, 65, 218, 693, 2138, 6497, 19602, 58949, 177026, 531297, 1594154, 4782773, 14348682, 43046465, 129139874, 387420165, 1162261106, 3486784001, 10460352762, 31381059125, 94143178298, 282429535905, 847288608818
Offset: 0
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (6,-12,10,-3).
Crossrefs
Programs
-
Magma
[3^n-n^2: n in [0..30]]; // Vincenzo Librandi, Jul 02 2011
-
Maple
A024025:=n->3^n-n^2: seq(A024025(n), n=0..50); # Wesley Ivan Hurt, Jan 11 2017
-
Mathematica
Table[3^n - n^2, {n, 0, 25}] (* or *) CoefficientList[Series[(1 - 4 x + 5 x^2 + 2 x^3)/((1 - 3 x) (1 - x)^3), {x, 0, 30}], x] (* Vincenzo Librandi, Oct 05 2014 *)
-
SageMath
[3^n-n^2 for n in range(31)] # G. C. Greubel, Aug 18 2023
Formula
G.f.: (1-4*x+5*x^2+2*x^3)/((1-3*x)*(1-x)^3). - Vincenzo Librandi, Oct 05 2014
a(n) = 6*a(n-1) -12*a(n-2) +10*a(n-3) -3*a(n-4) for n>3. - Vincenzo Librandi, Oct 05 2014
E.g.f.: exp(3*x) - x*(1+x)*exp(x). - G. C. Greubel, Aug 18 2023