login
A293333
The integer k that minimizes |k/2^n - sqrt(5)|.
4
2, 4, 9, 18, 36, 72, 143, 286, 572, 1145, 2290, 4579, 9159, 18318, 36636, 73271, 146543, 293086, 586172, 1172344, 2344687, 4689374, 9378749, 18757498, 37514995, 75029991, 150059982, 300119964, 600239927, 1200479854, 2400959709, 4801919417, 9603838835
OFFSET
0,1
LINKS
FORMULA
a(n) = floor(1/2 + r*2^n), where r = sqrt(5).
a(n) = A293331(n) if (fractional part of r*2^n) < 1/2, else a(n) = A293332(n).
MATHEMATICA
z = 120; r = Sqrt[5];
Table[Floor[r*2^n], {n, 0, z}]; (* A293331 *)
Table[Ceiling[r*2^n], {n, 0, z}]; (* A293332 *)
Table[Round[r*2^n], {n, 0, z}]; (* A293333 *)
PROG
(Python)
from math import isqrt
def A293333(n): return (k:=isqrt(m:=5*(1<<(n<<1))))+int((m-k*(k+1)<<2)-1>=0) # Chai Wah Wu, Jul 28 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Oct 10 2017
STATUS
approved