login
a(0)=1, a(1)=2, a(n) = 31*a(n-1) - 29*a(n-2).
1

%I #38 Dec 22 2023 14:32:49

%S 1,2,33,965,28958,869713,26121321,784539274,23563199185,707707535789,

%T 21255600833094,638400107288033,19173990901769297,575880114843495250,

%U 17296237823997043137,519482849213446974997,15602377428720941973934,468608697663159238917041

%N a(0)=1, a(1)=2, a(n) = 31*a(n-1) - 29*a(n-2).

%C The sequence A084330 is a(0)=0, a(1)=1, a(n)=31a(n-1)-29a(n-2), and the ratio A084330(n+1)/a(n) converges to phi^7 (~29.034441853748633...), where phi is the golden ratio (A001622).

%C The continued fraction for phi^7 is {29,{29}}, and 29 occurs in the following approximations for n*phi^7: A248786 (29*n+floor(n/29)+0^n-0^(n mod 29)) for A004922 (floor(n*phi^7)), A249079 (29*n+floor(n/29)+0^(1-floor((14+(n mod 29))/29)) for A004942 (round(n*phi^7)), and A248739 (29*n+ceiling(n/29)) for A004962 (ceiling(n*phi^7)).

%H Karl V. Keller, Jr., <a href="/A256278/b256278.txt">Table of n, a(n) for n = 0..1000</a>

%H Eric W. Weisstein, From MathWorld--A Wolfram Web Resource, <a href="http://mathworld.wolfram.com/GoldenRatio.html">Golden Ratio</a>

%H Eric W. Weisstein, From MathWorld--A Wolfram Web Resource, <a href="http://mathworld.wolfram.com/GoldenRatioConjugate.html">Golden Ratio Conjugate</a>

%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (31,-29).

%F G.f.: (1-29*x)/(29*x^2-31*x+1). - _Vincenzo Librandi_, Jun 03 2015

%e For n=3, 31*a(2)-29*a(1) = 31*(33)-29*(2) = 1023-58 = 965.

%p a:= n-> (<<0|1>, <-29|31>>^n. <<1, 2>>)[1,1]:

%p seq(a(n), n=0..23); # _Alois P. Heinz_, Dec 22 2023

%t LinearRecurrence[{31, -29}, {1, 2}, 50] (* or *) CoefficientList[Series[(1 - 29 x)/(29 x^2 - 31 x + 1), {x, 0, 33}], x] (* _Vincenzo Librandi_, Jun 03 2015 *)

%o (Python)

%o print(1, end=', ')

%o print(2, end=', ')

%o an = [1,2]

%o for n in range(2,26):

%o print(31*an[n-1]-29*an[n-2], end=', ')

%o an.append(31*an[n-1]-29*an[n-2])

%o (Magma) I:=[1,2]; [n le 2 select I[n] else 31*Self(n-1)-29*Self(n-2): n in [1..30]]; // _Vincenzo Librandi_, Jun 03 2015

%Y Cf. A001622, A195819 (29*n), A084330, A004922, A004942, A004962, A248786, A249079, A248739.

%K nonn,easy

%O 0,2

%A _Karl V. Keller, Jr._, Jun 02 2015