simply_a_square_root_by_factoring
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| simply_a_square_root_by_factoring [2026/10/27 09:22] – created frchris | simply_a_square_root_by_factoring [2026/10/27 09:35] (current) – frchris | ||
|---|---|---|---|
| Line 5: | Line 5: | ||
| If you know how to program a TI-84, you could do this for any positive integer with a program like [[https:// | If you know how to program a TI-84, you could do this for any positive integer with a program like [[https:// | ||
| + | |||
| + | Make a new project in BlueJ, and make a new class '' | ||
| + | |||
| + | - Declare a new static method that takes a integer n and returns a String | ||
| + | - Make two local variables, one for the coefficient , and one for a factor | ||
| + | - Put a 1 in the coefficient, | ||
| + | - While the factor is less than n, see if the factor squared divides n evenly | ||
| + | - If it does, multiply the factor to the coeffient, and divide out the squared factor from n. | ||
| + | - Keep doing this until the factor no longer divides n. | ||
| + | - Next, change the factor (which starts out as 2) to the next odd number | ||
| + | - return a String that starts with the coefficiant, | ||
| + | |||
| + | In BlueJ, you can run the static method directly, just like you usually do with the main method. | ||
simply_a_square_root_by_factoring.1793107334.txt.gz · Last modified: by frchris
