login
Greatest integer k such that k/2^n < sqrt(5).
4

%I #9 Jul 29 2022 09:56:56

%S 2,4,8,17,35,71,143,286,572,1144,2289,4579,9158,18317,36635,73271,

%T 146542,293085,586171,1172343,2344687,4689374,9378748,18757497,

%U 37514995,75029990,150059981,300119963,600239927,1200479854,2400959708,4801919417,9603838834

%N Greatest integer k such that k/2^n < sqrt(5).

%H Clark Kimberling, <a href="/A293331/b293331.txt">Table of n, a(n) for n = 0..1000</a>

%F a(n) = floor(r*2^n), where r = sqrt(5).

%F a(n) = A293332(n) - 1.

%t z = 120; r = Sqrt[5];

%t Table[Floor[r*2^n], {n, 0, z}]; (* A293331 *)

%t Table[Ceiling[r*2^n], {n, 0, z}]; (* A293332 *)

%t Table[Round[r*2^n], {n, 0, z}]; (* A293333 *)

%o (Python)

%o from math import isqrt

%o def A293331(n): return isqrt(5*(1<<(n<<1))) # _Chai Wah Wu_, Jul 28 2022

%Y Cf. A001633, A293332, A293333.

%K nonn,easy

%O 0,1

%A _Clark Kimberling_, Oct 10 2017