Skip to content

Instantly share code, notes, and snippets.

@AndyNovo
Created March 14, 2016 18:49
Show Gist options
  • Save AndyNovo/6fae5de354f91765a594 to your computer and use it in GitHub Desktop.
Save AndyNovo/6fae5de354f91765a594 to your computer and use it in GitHub Desktop.
def api(N, U):
M = matrix(ZZ, 2,2, [1, -floor(pi*2^N)*2^N, 0, 2^(2*N)])
M = U*M
M = U.augment(M)
UM = M.LLL()
return UM.submatrix(0,0,2,2)
U = identity_matrix(2)
for i in range(1,100):
U = api(3*i, U)
approx = U[0][1]/U[0][0]
print approx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment