[ prog / sol / mona ]

prog


e and the Stern-Brocot tree

47 2021-03-02 14:35

Stream index 10^9 for the Sqrt2 >>28 stream:

$ gawk '{ if (length ($0) < 1000) { print NR ": " $0 } else { print NR "! " length ($0) } }' sqrt29.txt
1:  group Expo (Fixed RLLR, 250000000)
2: target 1.414213562373095
3: result 1.414213562373095
4! 191387843
5! 191387843
6: stack 6

The hash of the numerator:

$ sha1sum <(gawk 'NR == 4 { printf "%s", $0 }' sqrt29.txt)
e726c20ee05cebf894df98462d5c793a08318c66  /dev/fd/63

The hash of the denominator:

$ sha1sum <(gawk 'NR == 5 { printf "%s", $0 }' sqrt29.txt)
86e33050005cc854e7ba9b734b9f2a2f1333e6a0  /dev/fd/63

A hypothesis >>43 >>44 presents itself. It would seem that the number of L -> R and R -> L switches is an indicator of the rate at which the numerator and denominator will grow.

spec  index    digits group
e     10^12   6167766 RRLRR(LRL[4+4*k]RLR[8+4*k])*
phi   10^9  208987641 (RL)*
sqrt2 10^9  191387843 (RLLR)*

The phi stream has the maximum number of switches a stream can have, and it grows the fastest. The sqrt2 stream has half the number of switches and it grows slower than phi. The e stream has contiguous runs of increasing length between switches, and it grows very slowly. This should predict the rate of growth of the other >>28 streams based on their generating pattern.

54


VIP:

do not edit these