OFFSET
0,3
COMMENTS
Pisano period lengths: 1, 1, 1, 1, 12, 1, 8, 1, 1, 12, 110, 1, 168, 8, 12, 2, 16, 1, 360, 12, ... - R. J. Mathar, Aug 10 2012
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (3,6).
FORMULA
a(n) = 3*a(n-1) + 6*a(n-2), a(0)=0, a(1)=1.
a(n) = (3*sqrt(33)/2 + 21/2)^(n/2)/sqrt(33) - (21/2 - 3*sqrt(33)/2)^(n/2)*(-1)^n/sqrt(33).
G.f.: Q(0)*x/2, where Q(k) = 1 + 1/(1 - x*(6*k+3 + 6*x )/( x*(6*k+6 + 6*x ) + 1/Q(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Sep 21 2013
a(n) = B(n, k + 2^(n-1)) - B(n,k) where B(n,k) is formed by the family of recursions b(n) = 3*(b(n-1) + b(n-2))/2, with b(0) = 1 and b(1) = k, as explained further in A249861. - Richard R. Forberg, Nov 04 2014
MATHEMATICA
a[n_]:=(MatrixPower[{{1, 2}, {1, -4}}, n].{{1}, {1}})[[2, 1]]; Table[Abs[a[n]], {n, -1, 40}] (* Vladimir Joseph Stephan Orlovsky, Feb 19 2010 *)
LinearRecurrence[{3, 6}, {0, 1}, 30] (* G. C. Greubel, Jan 16 2018 *)
PROG
(Sage) [lucas_number1(n, 3, -6) for n in range(0, 24)] # Zerinvary Lajos, Apr 22 2009
(PARI) x='x+O('x^30); concat([0], Vec(x/(1-3*x-6*x^2))) \\ G. C. Greubel, Jan 16 2018
(Magma) I:=[0, 1]; [n le 2 select I[n] else 3*Self(n-1) + 6*Self(n-2): n in [1..30]]; // G. C. Greubel, Jan 16 2018
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paul Barry, May 06 2003
STATUS
approved