OFFSET
1,1
REFERENCES
R. L. Graham, D. E. Knuth and O. Patashnick, "Concrete Mathematics", second edition, Addison Wesley, ex. 6.59.
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (4,-3).
FORMULA
a(1) = 3; for n > 1, a(n) = 3*a(n-1)-4; a(n) = 4*3^(n-2)+2.
From Colin Barker, May 01 2012: (Start)
a(n) = 4*a(n-1) - 3*a(n-2) for n > 3.
G.f.: x*(3 - 6*x - x^2)/((1-x)*(1-3*x)). (End)
E.g.f.: (1/9)*(4*exp(3*x) + 18*exp(x) - 3*x - 22). - Stefano Spezia, Nov 10 2019
MATHEMATICA
CoefficientList[Series[(3-6*x-x^2)/((1-x)*(1-3*x)), {x, 0, 40}], x] (* Vincenzo Librandi, Jun 23 2012 *)
PROG
(PARI) a(n)=if(n<0, 0, x=3; while((fibonacci(x)+1)%(3^n)>0, x++); x)
(Magma) I:=[3, 6, 14, 38]; [n le 4 select I[n] else 4*Self(n-1) -3*Self(n-2): n in [1..30]]; // Vincenzo Librandi, Jun 23 2012
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Benoit Cloitre, Feb 01 2003
STATUS
approved