Skip to content

Instantly share code, notes, and snippets.

@ajsya
Created March 1, 2025 21:03
Show Gist options
  • Save ajsya/1da42780a207a15b88a09961395cd988 to your computer and use it in GitHub Desktop.
Save ajsya/1da42780a207a15b88a09961395cd988 to your computer and use it in GitHub Desktop.
Python script for Ti-84 Plus Ce Python Edition that finds factors of most numbers somewhat slowly
n = int(input("Factors of what? "))
print("Finding all factors of {0}...".format(n))
w = n
while w != 0:
x = int(n/w)
if x == n/w:
if x == 1:
factors = [1]
else:
factors.append(x)
w = w - 1
y = len(factors) / 2
z = 0
to_say = ""
while y != 1:
to_say = to_say + "{0} & {1}, ".format(factors[0 + z],factors[-1 - z])
y = y - 1
z = z + 1
to_say = to_say + "{0} & {1}".format(factors[0 + z],factors[-1 - z])
print(to_say)
@ajsya
Copy link
Author

ajsya commented Mar 1, 2025

Broken for perfect squares for some reason

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment