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(5,45).
1

%I #24 Feb 11 2016 09:36:35

%S 5,45,406,3664,33067,298425,2693244,24306152,219359637,1979690177,

%T 17866428166,161242026212,1455186832835,13132858524565,

%U 118522219370436,1069646525028644,9653410934956277,87120689404042085,786252089896134534,7095815621924558952,64038747861388870507

%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(5,45).

%C This coincides with the linearly recurrent sequence defined by the expansion of (5 - 4*x^2)/(1 - 9*x - x^2 + 7*x^3) only up to n <= 103. - _Bruno Berselli_, Feb 11 2016

%H Harvey P. Dale, <a href="/A022022/b022022.txt">Table of n, a(n) for n = 0..1000</a>

%F a(n+1) = floor(a(n)^2/a(n-1))+1 for all n > 0. - _M. F. Hasler_, Feb 10 2016

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

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

%p end:

%p seq(a(n), n=0..30); # _Alois P. Heinz_, Sep 18 2015

%t nxt[{a_,b_}]:=Module[{c=Ceiling[b^2/a]},c=If[c<=b^2/a,c+1,c];{b,c}]; Transpose[NestList[nxt,{5,45},20]][[1]] (* _Harvey P. Dale_, Feb 11 2014 *)

%o (PARI) a=[5,45];for(n=2,30,a=concat(a,a[n]^2\a[n-1]+1));a \\ _M. F. Hasler_, Feb 10 2016

%Y Cf. A022018 - A022025, A022026 - A022032.

%K nonn

%O 0,1

%A _R. K. Guy_

%E Double-checked and edited by _M. F. Hasler_, Feb 10 2016