Skip to content

Instantly share code, notes, and snippets.

@yarjor
Created March 31, 2018 12:39
Show Gist options
  • Select an option

  • Save yarjor/ffb57e9b391bcc6655ba5467bcb16003 to your computer and use it in GitHub Desktop.

Select an option

Save yarjor/ffb57e9b391bcc6655ba5467bcb16003 to your computer and use it in GitHub Desktop.
[Find root] #math
def root(n, r):
u, s = n, n+1
while u < s:
s = u
t = (r - 1) * s + n / pow(s, r-1)
u = t / r
return s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment