Skip to content

Instantly share code, notes, and snippets.

@lpereira
Last active November 12, 2023 06:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lpereira/fe46ded39352c3ddf06bff95c6b6bfad to your computer and use it in GitHub Desktop.
Save lpereira/fe46ded39352c3ddf06bff95c6b6bfad to your computer and use it in GitHub Desktop.
#!/usr/bin/python
# https://www.youtube.com/watch?v=hm5qmqHUudQ
def regressao_julia(d, k):
# A fórmula enorme, segundo a jornalista:
return (d - k*k) // (k+k)
def raiz(n):
tentativa = n
while True:
r = regressao_julia(n, tentativa)
print(r, tentativa)
if r == 0:
return tentativa
tentativa += r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment