login
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(4,28).
1

%I #44 Jul 13 2023 09:38:19

%S 4,28,197,1387,9766,68764,484179,3409187,24004668,169020968,

%T 1190105509,8379736191,59003154006,415451286688,2925263479867,

%U 20597279875727,145028966176516,1021173725712004,7190258646781909,50627839422302787,356479265974341398

%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(4,28).

%C This coincides with the linearly recurrent sequence defined by the expansion of (4-3*x^2)/(1-7*x-x^2+5*x^3) only up to n<=55. - _R. J. Mathar_, Feb 10 2016

%H Alois P. Heinz, <a href="/A019482/b019482.txt">Table of n, a(n) for n = 0..1000</a>

%H D. W. Boyd, <a href="https://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/Ph#Pisot">Index entries for Pisot sequences</a>

%p a:= proc(n) option remember;

%p `if`(n<2, [4, 28][n+1], floor(a(n-1)^2/a(n-2))+1)

%p end:

%p seq(a(n), n=0..30); # _Alois P. Heinz_, Feb 10 2016

%t a[n_] := a[n] = Switch[n, 0, 4, 1, 28, _, Floor[a[n - 1]^2/a[n - 2]] + 1];

%t a /@ Range[0, 30] (* _Jean-François Alcover_, Feb 06 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(4, 28, 40) \\ _Colin Barker_, Feb 16 2016

%K nonn

%O 0,1

%A _R. K. Guy_