%I #23 Jul 13 2023 09:25:42
%S 2,7,25,90,325,1174,4241,15321,55349,199956,722370,2609667,9427803,
%T 34059315,123044249,444515318,1605876501,5801463374,20958633656,
%U 75716124779,273535557978,988187148996,3569970385786,12897039359739,46592438107869,168321986797406
%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(2,7).
%H Alois P. Heinz, <a href="/A018907/b018907.txt">Table of n, a(n) for n = 0..1000</a>
%H D. W. Boyd, <a href="https://www.researchgate.net/profile/David_Boyd7/publication/262181133_Linear_recurrence_relations_for_some_generalized_Pisot_sequences_-_annotated_with_corrections_and_additions/links/00b7d536d49781037f000000.pdf">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/Ph#Pisot">Index entries for Pisot sequences</a>
%p a:= proc(n) option remember; `if`(n<2, [2, 7][n+1],
%p 1 +floor(a(n-1)^2/a(n-2)))
%p end:
%p seq(a(n), n=0..40); # _Alois P. Heinz_, May 05 2014
%t a[n_] := a[n] = Switch[n, 0, 2, 1, 7, _, 1 + Floor[a[n-1]^2/a[n-2]]];
%t a /@ Range[0, 40] (* _Jean-François Alcover_, Nov 16 2020, after _Alois P. Heinz_ *)
%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(2, 7, 40) \\ _Colin Barker_, Feb 16 2016
%K nonn
%O 0,1
%A _R. K. Guy_, Dec 11 1996