I am writing a program and need the factors of a given number. The only way I know to do this is by graphing the equation "n/x" and using the table to find the whole numbers. The problem with this is that I can't figure out how to store these numbers to a list. I am relatively new to programming on TI calculators so any help would be appreciated. Here is what I have so far:
|Code||My thought process|
|:ClrList L1||Clear list 1|
|:Input "Enter Number: ",A||Enter number|
|:"A/X" -> Y0||Enter equation Y0=A/X|
|:A -> dim(L1)||Put A many lines in list 1|
|:For(B,1,A)||For the numbers 1 through A|
|:If fPart(A/Y0(B)=0||Check if each y value is a factor of A|
|:Y0(B) -> L1(B)||Move that value to list 1|
|:End||End for loop|
|:A -> L1(A||Also add A to list 1|
With this code, after I enter A and look at list 1, every value is 0..
If you have a way to fix my code or something completely different, please share it with me.
Thanks for your help!