simply_a_square_root_by_factoring
This is an old revision of the document!
Simplfy a Square Root by Factoring
In Algebra I, we learned that the square root of 8 (√8) is 2 times the square root of 2 (2√2), √360 is 6√10.
If you know how to program a TI-84, you could do this for any positive integer with a program like RAD
Make a new project in BlueJ, and make a new class MyMath.
- 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, and the first prime 2 into the factor
- 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, then the
vcharacter, then what is left ofn
simply_a_square_root_by_factoring.1793108061.txt.gz · Last modified: by frchris
