[ prog / sol / mona ]

prog


e and the Stern-Brocot tree

50 2021-03-03 11:07

(Sqrt3, 10^9) >>28:

$ gawk '{ if (length ($0) < 1000) { print NR ": " $0 } else { print NR "! " length ($0) } }' sqrt39.txt
1:  group List (Expo (Fixed RLR, 333333333), Fixed R)
2: target 1.732050807568877
3: result 1.732050807568877
4! 190649183
5! 190649183
6: stack 7

Numerator/denominator hashes:

$ sha1sum <(gawk 'NR == 4 { printf "%s", $0 }' sqrt39.txt)
d464586d1eccfb68056109d70d486a142f9d8992  /dev/fd/63
$ sha1sum <(gawk 'NR == 5 { printf "%s", $0 }' sqrt39.txt)
98fcfa9aada30daa813b423f30f79a1d6390b902  /dev/fd/63

(Sqrt5, 10^9) >>28:

$ gawk '{ if (length ($0) < 1000) { print NR ": " $0 } else { print NR "! " length ($0) } }' sqrt59.txt
1:  group Expo (Fixed RRLLLLRR, 125000000)
2: target 2.236067977499790
3: result 2.236067977499790
4! 156740731
5! 156740731
6: stack 6

Numerator/denominator hashes:

$ sha1sum <(gawk 'NR == 4 { printf "%s", $0 }' sqrt59.txt)
c6e680622d444ae51479e5f4f8e2f2902436674f  /dev/fd/63
$ sha1sum <(gawk 'NR == 5 { printf "%s", $0 }' sqrt59.txt)
7396e2d4afd5060c98e11267bbb4c80389325a35  /dev/fd/63

(Sqrt7, 10^9) >>28:

$ gawk '{ if (length ($0) < 1000) { print NR ": " $0 } else { print NR "! " length ($0) } }' sqrt79.txt
1:  group List (Expo (Fixed RRLRLRR, 142857142), Fixed RRLRLR)
2: target 2.645751311064591
3: result 2.645751311064591
4! 171773357
5! 171773356
6: stack 7

Numerator/denominator hashes:

$ sha1sum <(gawk 'NR == 4 { printf "%s", $0 }' sqrt79.txt)
06253fc6faf29a64a2cc1bd2a0b159e2968865ab  /dev/fd/63
$ sha1sum <(gawk 'NR == 5 { printf "%s", $0 }' sqrt79.txt)
e91a7792c7c4c91e0c57b432036306c4c72b83c1  /dev/fd/63
54


VIP:

do not edit these