Divisibility Problem: Fast Algorithm for Large Integers A and B

  • Context: Graduate 
  • Thread starter Thread starter mhill
  • Start date Start date
  • Tags Tags
    Divisibility
Click For Summary
SUMMARY

The forum discussion addresses efficient algorithms for calculating the remainder of the division of large integers A and B. For integers under 100 digits, traditional methods suffice, but for larger integers, specifically those with 10,000 to 100,000 digits, FFT-based multiplication algorithms, such as Strassen's algorithm and Furer's algorithm, are recommended. These methods utilize Newton's method, achieving a time complexity of O(n log n log log n), which is superior to higher-order division methods.

PREREQUISITES
  • Understanding of Newton's method for division
  • Familiarity with Karatsuba multiplication
  • Knowledge of FFT-based multiplication algorithms
  • Basic concepts of time complexity analysis
NEXT STEPS
  • Research Strassen's algorithm for matrix multiplication
  • Explore Furer's algorithm for quasilinear multiplication
  • Learn about the implementation of FFT in numerical computations
  • Study advanced time complexity analysis techniques
USEFUL FOR

Mathematicians, computer scientists, and software engineers focused on optimizing algorithms for large integer arithmetic and those interested in advanced computational methods.

mhill
Messages
180
Reaction score
1
given two integers A and B that are very big is there any 'fast' algorithm to calculate the remainder of the division [tex]\frac{A}{B}[/tex] or in other similar words to say if B divides or not A thanks.
 
Physics news on Phys.org
How big? Are the numbers likely to have small prime factors?
For numbers under 100 digits, any reasonable program can do the calculation 'in the blink of an eye'.

Newton's method can be used to divide two numbers in time [itex]O(n^{1.585})[/itex] using Karatsuba multiplication.

For truly huge numbers (10,000 to 100,000 or more digits), FFT-based multiplication algorithms like Strassen's algorithm or the new Furer's algorithm provide quasilinear division using Newton's method.

I don't know of the success, in general, of higher-order methods for division, but I can't imagine any can outdo the [itex]O(n\log n\log\log n)[/itex] of the FFT methods I mentioned.
 

Similar threads

  • · Replies 17 ·
Replies
17
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
9
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
14
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
86
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K