OFFSET
1,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,1,-1).
FORMULA
From Harvey P. Dale, Aug 10 2011: (Start)
a(n) = a(n-1) + a(n-2) - a(n-3), a(1)=1, a(2)=23, a(3)=13, for n>3.
G.f.: x*(1+22*x-11*x^2)/((x-1)^2*(1+x)). (End)
E.g.f.: 8*exp(-x) + 3*(1 + 2*x)*exp(x) - 11. - G. C. Greubel, May 16 2016
Sum_{n>=1} (-1)^(n+1)/a(n) = 1/11 + (1/6 + 1/(4*sqrt(3)))*Pi. - Amiram Eldar, Feb 24 2023
a(n) = 6*n + 3 + 8*(-1)^n. - G. C. Greubel, Aug 04 2024
MATHEMATICA
RecurrenceTable[{a[1]==1, a[n]==12n-a[n-1]}, a[n], {n, 60}] (* or *) LinearRecurrence[{1, 1, -1}, {1, 23, 13}, 60] (* Harvey P. Dale, Aug 10 2011 *)
CoefficientList[Series[(1 + 22 x - 11 x^2) / ((x - 1)^2 (1 + x)), {x, 0, 60}], x] (* Vincenzo Librandi, Sep 13 2013 *)
PROG
(Magma) [n eq 1 select 1 else 12*n-Self(n-1): n in [1..80]]; // Vincenzo Librandi, Sep 13 2013
(SageMath)
def A166526(n): return 6*n - 5 + 16*((n+1)%2)
[A166526(n) for n in range(1, 101)] # G. C. Greubel, Aug 04 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Oct 16 2009
STATUS
approved