login
A024077
a(n) = 7^n - n^2.
2
1, 6, 45, 334, 2385, 16782, 117613, 823494, 5764737, 40353526, 282475149, 1977326622, 13841287057, 96889010238, 678223072653, 4747561509718, 33232930569345, 232630513986918, 1628413597910125, 11398895185372782
OFFSET
0,2
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
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 *)
PROG
(Magma) [7^n-n^2: n in [0..25]]; // Vincenzo Librandi, Jul 03 2011
(PARI) a(n)=7^n-n^2 \\ Charles R Greathouse IV, Oct 06 2014
CROSSREFS
Cf. similar sequences listed in A024025.
Sequence in context: A214982 A360021 A189801 * A097129 A048663 A095003
KEYWORD
nonn,easy
AUTHOR
STATUS
approved