-
-
Save pbevin/f42c30ff28f085ac3b11 to your computer and use it in GitHub Desktop.
Ruby version of https://gist.github.com/pbevin/b87beb6c00969697b690
This file contains 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
q,r,t,k,n = 1,0,1,1,2,3 | |
loop do | |
if 2*q+r-t < n*t | |
print n | |
q,r,t,k,n = 10*q,10*(r-n*t),t,k,(10*(q+r))/t-10*n | |
else | |
r,t,k,n = (q+r)*k, t*k, k+1, (q+r*k)/(t*k) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment