A024077 a(n) = 7^n - n^2.
1, 6, 45, 334, 2385, 16782, 117613, 823494, 5764737, 40353526, 282475149, 1977326622, 13841287057, 96889010238, 678223072653, 4747561509718, 33232930569345, 232630513986918, 1628413597910125, 11398895185372782
Offset: 0
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..500
- Index entries for linear recurrences with constant coefficients, signature (10,-24,22,-7).
Crossrefs
Cf. similar sequences listed in A024025.
Programs
-
Magma
[7^n-n^2: n in [0..25]]; // Vincenzo Librandi, Jul 03 2011
-
Mathematica
Table[7^n - n^2, {n, 0, 25}] (* or *) CoefficientList[Series[(1 - 4 x + 9 x^2 + 6 x^3)/((1 - 7 x) (1 - x)^3), {x, 0, 30}], x] (* Vincenzo Librandi, Oct 06 2014 *) LinearRecurrence[{10,-24,22,-7},{1,6,45,334},20] (* Harvey P. Dale, Sep 16 2023 *)
-
PARI
a(n)=7^n-n^2 \\ Charles R Greathouse IV, Oct 06 2014
Formula
G.f.: (1-4*x+9*x^2+6*x^3)/((1-7*x)*(1-x)^3). - Vincenzo Librandi, Oct 06 2014
a(n) = 10*a(n-1) -24*a(n-2) +22*a(n-3) -7*a(n-4) for n>3. - Vincenzo Librandi, Oct 06 2014