Jump to content

Stern-Brocot sequence: Difference between revisions

m
no edit summary
m (fix a mistranslation of the Python version's indexing)
mNo edit summary
Line 3,040:
function sternbrocot(f::Function=(x) -> length(x) ≥ 20)::Vector{Int}
rst = Int[1, 1]
i = 32
while !f(rst)
append!(rst, Int[rst[i-1] + rst[i-21], rst[i-2]])
i += 1
end
4,108

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.