Created
March 1, 2025 21:03
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Broken for perfect squares for some reason