[ prog / sol / mona ]

prog


e and the Stern-Brocot tree

13 2021-02-10 02:41 *

Some other nice patterns in the Stern-Brocot tree:

> (brocot-string (sqrt 2) 32)
'(R L L R R L L R R L L R R L L R R L L R R L L R R L L R R L L R)
> (brocot-string (sqrt 3) 32)
'(R L R R L R R L R R L R R L R R L R R L R R L R R L R R L R R L)
> (define phi (/ (+ 1 (sqrt 5)) 2))
> (brocot-string phi 32)
'(R L R L R L R L R L R L R L R L R L R L R L R L R L R L R L R L)
54


VIP:

do not edit these