The limit of a factoring algorithm

In general, if we're looking for divisors of n, we only need to look for primes up to sqrt(n) (since if n = ab, then either a or b must be less than or equal to sqrt(n)). Note that this means we only need to check half as many numbers as we would if we started at 1 and went up to n.If we're looking for prime factors of n, we only need to look for primes up to \sqrt[3]{n} (since if n = abc, then either a, b, or c must be less than or equal to \sqrt[3]{n}). Note that this means we only need to
  • #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
 
Physics news on Phys.org
  • #2
The mirror occurs at half way >.< Whilst the square root occurs earlier, which is why we use that observation instead.
 
  • #3
Eus: if you can factor your number as

[itex]N = A \times B[/itex] (with [itex]A \leq B[/itex])

then it is well known that [itex]A \leq \sqrt{N} \leq B[/itex].
 
  • #4
Suppose you can check divisibility in 10 ns. Then factoring a number by checking sequential numbers takes

10 digits:
1 minute (N/2)
1 ms (sqrt(N))

16 digits:
1.5 years (N/2)
1 second (sqrt(N))

20 digits:
15 millennia (N/2)
2 minutes (sqrt(N))

Of course good factoring methods are much better. Pari, which isn't really all that fast in general, factored the random 20-digit semiprime 42731646881968660727 in 156 ms. For larger numbers the difference is more pronounced: for 30 digits, the sqrt method would take 4 months while Pari took 516 ms (for 9981479919456039576778843766369589135143).
 
  • #5
Hi Ho!

Thank you for all of the replies, especially, CRGreathouse for giving me information on PARI/GP.

What I can conclude is that there is no quick way to determine the number of factors that an integer number has.

If suppose there is a function [tex]f(n)[/tex] that can give us the number of factors of an integer number [tex]n[/tex], then we know that the mirroring will occur after we get the [tex](\left\lceil\frac{f(n)}{2}\right\rceil)[/tex]-th factor.

But, there is no such a function, right?


Eus
 
  • #6
Of course there is such a function, you just defined it.
 
  • #7
Eus said:
If suppose there is a function [tex]f(n)[/tex] that can give us the number of factors of an integer number [tex]n[/tex], then we know that the mirroring will occur after we get the [tex](\left\lceil\frac{f(n)}{2}\right\rceil)[/tex]-th factor.

Suppose [tex]N=n_1^{a_1}\cdot n_2^{a_2}\cdots n_k^{a_k}[/tex].

Then [itex]\omega(n)=k[/itex], [itex]\Omega(n)=a_1+a_2+\cdots+a_k[/itex], and [itex]\sigma_0(n)=(a_1+1)(a_2+1)\cdots(a_k+1)[/itex]. There are three standard functions that count factors: distinct prime factors, indistinct prime factors, and total factors.

The mirroring point you're looking for happens at the square root. Notice that in your example, [itex]\sqrt{24}\approx4.9[/itex] and the mirror is between 4 and 6.
 
  • #8
The OP wants a way to compute the exact number (in the case of 24, it would be 4) beyond which you don't need to check anything.

I would be surprised if this was easy to do. I'd expect it would be faster to just bite the bullet and go on up to the square root.
 
  • #9
Xevarion said:
The OP wants a way to compute the exact number (in the case of 24, it would be 4) beyond which you don't need to check anything.

I would be surprised if this was easy to do. I'd expect it would be faster to just bite the bullet and go on up to the square root.

You can take L = the lcm of the factors you find so far, and then you only need to check up to floor(sqrt(N / L)). Of course when you look at the process as factoring rather than finding divisors this is obvious.
 
  • #10
CRGreathouse said:
Suppose [tex]N=n_1^{a_1}\cdot n_2^{a_2}\cdots n_k^{a_k}[/tex].

Then [itex]\omega(n)=k[/itex], [itex]\Omega(n)=a_1+a_2+\cdots+a_k[/itex], and [itex]\sigma_0(n)=(a_1+1)(a_2+1)\cdots(a_k+1)[/itex]. There are three standard functions that count factors: distinct prime factors, indistinct prime factors, and total factors.

The mirroring point you're looking for happens at the square root. Notice that in your example, [itex]\sqrt{24}\approx4.9[/itex] and the mirror is between 4 and 6.

Thank you very much for pointing out that the mirroring will happen approximately after finding the ([itex]\sqrt{n}[/itex])-th factor. This way I can determine the worst running time of such an algorithm and the memory space needed to contain all of factors of an integer number [itex]n[/itex].

Moreover, you also mentioned three interesting functions.
If [itex]N=24[/itex] then [itex]24=2^{3}\cdot 3^{1}[/itex]. So, [itex]\omega(24)=4[/itex], [itex]\Omega(24)=4[/itex], and [itex]\sigma_0(24)=8[/itex].
The number of indistinct prime factors is 4. How do you define indistinct prime factors?
Do you mean that they are [itex]4, 6, 8, 12[/itex] for [itex]N=12[/itex]?

I don't get what you mean below. Isn't that [itex]\sqrt{N}[/itex] is all that counts? I would be glad if you could explain further.
CRGreathouse said:
You can take L = the lcm of the factors you find so far, and then you only need to check up to floor(sqrt(N / L)).

Thank you very much.

Regards,
Eus
 
Last edited:
  • #11
Eus said:
How do you define indistinct prime factors?
Do you mean that they are [itex]4, 6, 8, 12[/itex] for [itex]N=12[/itex]?

4, 6, 8, and 12 are all composite (none are prime), so I don't call them indistinct prime factors. Consider the prime factors of 12 = 2 x 2 x 3. It has three prime factors, (2, 2, 3), but only two distinct prime factors, {2, 3}. So [itex]\omega(12)=2[/itex] but [itex]\Omega(12)=3[/itex].

[tex]\omega(1024) = 1, \Omega(1024) = 10[/tex] since 1024 = 2^10.
 
  • #12
Eus said:
Thank you very much for pointing out that the mirroring will happen approximately after finding the ([itex]\sqrt{n}[/itex])-th factor. This way I can determine the worst running time of such an algorithm and the memory space needed to contain all of factors of an integer number [itex]n[/itex].

The mirror is at sqrt(n), not the sqrt(n)th factor. You can always stop factoring at the square root of the number you're on; all divisors above sqrt(n) can be found by dividing n by the smaller divisors.

This is easy to see: if k > sqrt(n), and h > sqrt(n), then k * h > sqrt(n) * sqrt(n) = n and so h * k is not a factor of n.
 
Last edited:

Related to The limit of a factoring algorithm

1. What is the limit of a factoring algorithm?

The limit of a factoring algorithm refers to the maximum size or complexity of a number that the algorithm can efficiently factor. This limit is often determined by the specific method or approach used in the algorithm and can vary depending on the algorithm's efficiency and computational complexity.

2. How is the limit of a factoring algorithm determined?

The limit of a factoring algorithm is determined by various factors, including the algorithm's design, the computational resources available, and the size and complexity of the numbers being factored. In general, the more efficient and optimized an algorithm is, the higher its limit will be.

3. What is the significance of the limit of a factoring algorithm?

The limit of a factoring algorithm is significant because it determines the largest numbers that can be efficiently factored using that particular algorithm. It also serves as a benchmark for comparing the efficiency of different factoring algorithms and can indicate the potential applications and limitations of a particular algorithm.

4. Can the limit of a factoring algorithm be improved?

Yes, the limit of a factoring algorithm can be improved through advancements in computational technology and the development of more efficient algorithms. However, there may always be a theoretical limit for factoring large numbers due to the inherent complexity of the factoring problem.

5. How does the limit of a factoring algorithm impact cryptography?

The limit of a factoring algorithm is directly related to the security of certain cryptographic systems, such as the widely used RSA algorithm. If the limit of a factoring algorithm can be surpassed, it could potentially compromise the security of these systems, making it crucial to continually improve and monitor the limit of factoring algorithms.

Similar threads

  • Precalculus Mathematics Homework Help
Replies
5
Views
854
Replies
27
Views
1K
  • Precalculus Mathematics Homework Help
Replies
3
Views
964
Replies
5
Views
2K
Replies
55
Views
3K
  • Science Fiction and Fantasy Media
Replies
0
Views
1K
Replies
2
Views
1K
  • Linear and Abstract Algebra
Replies
1
Views
2K
  • Linear and Abstract Algebra
Replies
2
Views
984
Back
Top