Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Finding primes given a condition

  1. Oct 8, 2004 #1
    Hi, I need help solving this problem. The question asks me to find all prime numbers p such that p^2 = n^3 + 1 for some integer n.
  2. jcsd
  3. Oct 9, 2004 #2


    User Avatar
    Science Advisor
    Homework Helper

    This is really quite easy as p^2 can only be p times p or 1 times p^2.

    Now, [tex]n^3 + 1 = (n + 1)(n^2 - n + 1)[/tex]

    So one possible solution is where one of the factors is equal to 1 and the other is equal to p^2. Or when they are both equal to each other. Test those out and you should find all the possible solutions for n.
  4. Oct 13, 2004 #3
    An alternative,
    all odd p^2 is usually of the form
    p^2 = 1 mod 4

    n^3+1 = 1 mod 4
    or n^3 = 0 mod 4

    Now this is useful if and only if u have a list of primes ...
    So first u can generate a list and then check for conditions ...

    -- AI
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook