Created
October 15, 2017 16:38
-
-
Save joshuashaffer/822f1956f0a1a153c51752a579c54dc0 to your computer and use it in GitHub Desktop.
Get the n-th digit on the sqrt(2)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| w x r=d:w(100*(x-20*r*d-d*d))(10*r+d)where d=head(filter(\d -> 20*r*d+d*d>=x)[0..])-1 | |
| nthSqrt2 n d=foldl1(++).map show.map((!!)$w 2 0)$[(1+n)..(d+n)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment