VOOZH about

URL: https://www.geeksforgeeks.org/dsa/fermats-last-theorem/

⇱ Fermat's Last Theorem - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Fermat's Last Theorem

Last Updated : 23 Jun, 2022

According to Fermat's Last Theorem, no three positive integers a, b, c satisfy the equation, for any integer value of n greater than 2. For n = 1 and n = 2, the equation have infinitely many solutions.
 

Some solutions for n = 1 are,
 2 + 3 = 5
 7 + 13 = 20
 5 + 6 = 11
 10 + 9 = 19

Some solutions for n = 2 are,


 


Output: 
No counter example within given range and data

 

Time Complexity: O(m2logn) , where m is the limit
Auxiliary Space: O(1)

Please suggest if someone has a better solution which is more efficient in terms of space and time.

Comment
Article Tags: