%I #19 Feb 12 2016 13:22:51
%S 2,32,513,8224,131841,2113576,33883265,543191088,8708032065,
%T 139600638008,2237972711489,35877499765312,575161163852417,
%U 9220552339712072,147816978601123073,2369690920646861904
%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,32).
%C There is a discrepancy between terms and definition. The definition constructs 2, 32, 513, 8225, 131873, 2114346, 33899730,... - _R. J. Mathar_, Feb 10 2016
%C The data agrees with the following definition: if n is even, a(n+2) is the least integer such that a(n+2)/a(n+1) > a(n+1)/a(n), but if n is odd, a(n+2) is the greatest integer such that a(n+2)/a(n+1) < a(n+1)/a(n). - _Robert Israel_, Feb 11 2016
%H Robert Israel, <a href="/A022019/b022019.txt">Table of n, a(n) for n = 0..828</a> (using my definition)
%F (With my definition) a(n+3)-16*a(n+2)-a(n+1)+8*a(n) = 0 holds for at least n = 0 to 20000, but this may not always be the case. - _Robert Israel_, Feb 11 2016
%p # This agrees with the given Data
%p g:= proc(t,n) if n::even then floor(t+1) else ceil(t-1) fi end proc:
%p A[0]:= 2: A[1]:= 32:
%p for n from 2 to 50 do A[n]:= g(A[n-1]^2/A[n-2],n) od:
%p seq(A[i],i=0..50); # _Robert Israel_, Feb 11 2016
%o (PARI) a=List([2,32]);for(n=2,50,listput(a,a[n]^2\a[n-1]+1));Vec(a) \\ _M. F. Hasler_, Feb 10 2016
%K nonn
%O 0,1
%A _R. K. Guy_