- #1
Eus
- 94
- 0
Hi Ho!
It is easy to observe that to get all factors of an integer n, one does not need to try whether a divides n for 1 < a < n.
But, rather using the following observation:
Suppose n is 24, then
24 / 1 = 24
24 / 2 = 12
24 / 3 = 8
24 / 4 = 6
-------------(!)
24 / 6 = 4
24 / 8 = 3
24 / 12 = 2
24 / 24 = 1
Notice that after (!), the divisor and the result of each probing step are just the swap of the divisor and the result of each probing step before (!). With other words, (!) acts as a mirror. Therefore, to find all factors of an integer n, one only needs to record both the divisor and the result of each probing step until the first swap happens, or until the values of the divisor and the result are the same such as when n = 49.
We know that, to test whether an integer number n is prime or not, one only needs to try to divide n by an integer from 2 until square root of n. Is it possible to predict before hand at what n-th factor the mirroring will occur?
Thanks.
Regards,
Eus
It is easy to observe that to get all factors of an integer n, one does not need to try whether a divides n for 1 < a < n.
But, rather using the following observation:
Suppose n is 24, then
24 / 1 = 24
24 / 2 = 12
24 / 3 = 8
24 / 4 = 6
-------------(!)
24 / 6 = 4
24 / 8 = 3
24 / 12 = 2
24 / 24 = 1
Notice that after (!), the divisor and the result of each probing step are just the swap of the divisor and the result of each probing step before (!). With other words, (!) acts as a mirror. Therefore, to find all factors of an integer n, one only needs to record both the divisor and the result of each probing step until the first swap happens, or until the values of the divisor and the result are the same such as when n = 49.
We know that, to test whether an integer number n is prime or not, one only needs to try to divide n by an integer from 2 until square root of n. Is it possible to predict before hand at what n-th factor the mirroring will occur?
Thanks.
Regards,
Eus