Skip to content

Instantly share code, notes, and snippets.

@thomasjslone
Last active November 6, 2021 21:57
Show Gist options
  • Save thomasjslone/8ecda64238e202da9fd3bd1df351d9c2 to your computer and use it in GitHub Desktop.
Save thomasjslone/8ecda64238e202da9fd3bd1df351d9c2 to your computer and use it in GitHub Desktop.
ya there be bugs in there
##
## Python
##
def exp(n):
c=2
e=2
rv=False
while c<=n:
e=2
while e<=n:
if c**e==n:
return [c,e]
e=e+1
c=c+1
##
## Ruby
##
def exponate(n)
c=2
e=2
until c > n.to_i
e = 2
until e >= n.to_i
if c**e == n.to_i
return [c,e]
end
e+=1
end
c+=1
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment