OFFSET
0,2
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).
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
KEYWORD
nonn,easy
AUTHOR
STATUS
approved