Factor the prime

Discussion in 'Physics & Math' started by Absane, Aug 6, 2006.

  1. Absane Rocket Surgeon Valued Senior Member

    Messages:
    8,989
    3 years ago, I was in a math tourny and I had this problem:

    If a and b are integers and a<sup>2</sup> - b<sup>2</sup> = 2003
    Find a<sup>2</sup> + b<sup>2</sup>.

    Well, I happened to know that 2003 is a prime number (I was graduating that year and thought it would be cool if 2003 was a prime.. so I tested it a few weeks before the tourny).

    I solved the problem because a<sup>2</sup> - b<sup>2</sup> = (a + b)*(a - b), so a + b = 2003 and a - b = 1. Solving, a = 1002 and b = 1001. Then the rest is just plug-and-chug.

    My question is: what is another way to solve this?
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. Naat Scientia potestas est. Registered Senior Member

    Messages:
    211
    Trying different numbers until it fits.
     
  4. Google AdSense Guest Advertisement



    to hide all adverts.
  5. Absane Rocket Surgeon Valued Senior Member

    Messages:
    8,989
    Lol... well the point is this was a timed test. Like 30 question.. 15 minutes. Meaning I have 15 seconds to produce an answer. My way got me the right answer... but I don't think 15 seconds is enough time to do so.

    I remember my teacher showing me how he did it (since he didn't know 2003 is a prime number). However, I wasn't paying attention but now I want to know.
     
  6. Google AdSense Guest Advertisement



    to hide all adverts.
  7. nicholas1M7 Banned Banned

    Messages:
    1,417
    It seems you have to find out if its a prime number first because;

    if a2-b2 = a prime number, then a-b=1.

    But let's say you do not know if the number is a prime. We could try completing the square, http://mathworld.wolfram.com/QuadraticEquation.html. That's the only way I remember how to do it. I made 84% on my last math assignment.
     
  8. Absane Rocket Surgeon Valued Senior Member

    Messages:
    8,989
    I would think completing the square would work. I never really tried it though. However, you don't need to know 2003 is a prime to solve the problem as my old HS teacher solved it without this knowledge. However I am fairly sure the property of 2003 being prime is what lead to the solution, not really knowing it is.
     
  9. Dinosaur Rational Skeptic Valued Senior Member

    Messages:
    4,885
    Almost every math tourney problem has a brute force solution and a See the gimmick solution. If you do not see the gimmick or get lucky (like knowing that 2003 is prime), you do not have time to finish much of the test.

    For this problem, the brute force approach requires factoring 2003 to find possible values for (a+b) & (a-b). Factoring 2003 takes a bit more time than you have, but not an exhorbitant amount. You only have to try prime numbers from 7 to 43 (SquareRoot(2003) can be quickly estimated to be a bit less than 45). If allowed to use a hand calculator, it is can be done almost fast enough for a timed test. .

    The gimmick solution requires immediately recognizing that if 2003 is not prime, there are two or more possible answers. Ergo, 2003 must be prime or there is no unique answer.

    For example: 2021 = 47*43 and 2021 = 2021*1, resulting in the following

    (a+b) = 47 & (a-b) = 43 as well as (a+b) = 2021 & (a-b) = 1

    If you do not know that a<sup>2</sup> - b<sup>2</sup> =(a+b)*(a-b), you have no chance of solving the problem in the time allowed. This is a trivial gimmick that all should know.
     

Share This Page