OFFSET
1,2
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,1,-1).
FORMULA
G.f.: x*(1+12*x-6*x^2) / ( (1+x)*(1-x)^2 ). - R. J. Mathar, Mar 08 2011
a(n) = a(n-1) + a(n-2) - a(n-3), a(1)=1, a(2)=13, a(3)=8. - Harvey P. Dale, Jun 07 2012
E.g.f.: (1/4)*(17*exp(-x) + 7*(1 + 2*x)*exp(x) - 24). - G. C. Greubel, May 16 2016
a(n) = (1/4)*(14*n + 7 + 17*(-1)^n). - G. C. Greubel, Aug 03 2024
MATHEMATICA
RecurrenceTable[{a[1]==1, a[n]==7n-a[n-1]}, a, {n, 60}] (* or *) LinearRecurrence[{1, 1, -1}, {1, 13, 8}, 60] (* Harvey P. Dale, Jun 07 2012 *)
PROG
(Magma)
A166522:= func< n | ( 7*n -5 +17*((n+1) mod 2) )/2 >;
[A166522(n): n in [1..100]]; // G. C. Greubel, Aug 03 2024
(SageMath)
def A166522(n): return ( 7*n -5 +17*((n+1)%2) )//2
[A166522(n) for n in range(1, 101)] # G. C. Greubel, Aug 03 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Oct 16 2009
STATUS
approved