%I #45 Jul 13 2023 09:24:40
%S 1,6,37,229,1418,8781,54377,336734,2085253,12913101,79965442,
%T 495192589,3066520913,18989683446,117595179557,728217839669,
%U 4509548979898,27925753660941,172932530727097,1070898946784974,6631629973859333,41066915083090461,254310255712336562
%N Define the sequence S(a(0),a(1)) by a(n+2) is the least integer such that a(n+2)/a(n+1) > a(n+1)/a(n) for n >= 0. This is S(1,6).
%C a(n) is the number of compositions of n when there are 6 types of ones. - _Milan Janjic_, Aug 13 2010
%C Number of words of length n over {0,1,...,7} in which binary subwords appear in the form 10...0. - _Milan Janjic_, Jan 25 2017
%H Colin Barker, <a href="/A018904/b018904.txt">Table of n, a(n) for n = 0..1000</a>
%H D. W. Boyd, <a href="http://www.researchgate.net/publication/258834801">Linear recurrence relations for some generalized Pisot sequences</a>, Advances in Number Theory ( Kingston ON, 1991) 333-340, Oxford Sci. Publ., Oxford Univ. Press, New York, 1993.
%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (7,-5).
%H <a href="/index/Ph#Pisot">Index entries for Pisot sequences</a>
%F a(n) = (a(1)+1)*a(n-1) - (a(1)-1)*a(n-2) = 7*a(n-1) - 5*a(n-2).
%F G.f.: -(x-1) / (5*x^2-7*x+1). - _Colin Barker_, Feb 14 2013
%F a(n) = (2^(-1-n)*((7-sqrt(29))^n*(-5+sqrt(29)) + (5+sqrt(29))*(7+sqrt(29))^n)) / sqrt(29). - _Colin Barker_, Jan 20 2017
%t Table[Simplify[(2^(-1 - n) ((7 - #)^n (-5 + #) + (5 + #) (7 + #)^n))/#] &@ Sqrt@ 29, {n, 0, 22}] (* or *)
%t CoefficientList[Series[-(x - 1)/(5 x^2 - 7 x + 1), {x, 0, 22}], x] (* _Michael De Vlieger_, Jan 28 2017 *)
%t LinearRecurrence[{7,-5},{1,6},30] (* _Harvey P. Dale_, May 01 2022 *)
%o (PARI) S(a0, a1, maxn) = a=vector(maxn); a[1]=a0; a[2]=a1; for(n=3, maxn, a[n]=a[n-1]^2\a[n-2]+1); a
%o S(1, 6, 40) \\ _Colin Barker_, Feb 16 2016
%K nonn,easy
%O 0,2
%A _R. K. Guy_