URGENT HELP!Squares into Primes

Some primes can be expressed as the sum of two squares, as in 13=2^2+3^2; some can't:7=/=a^2+b^2. Other primes can be c^2+2e^2 like 11=3^2+2*1^2; still others are f^2+3 g^2, like 31=2^2+ 3* 3^2.
Find all the primes less than 100 that can be each written in all three ways: p=a^2+b^2=c^2+2 e^2= f^2+3 g^2, and show how its done with each one (as above with 13, 11, and 31) The numbers you are squaring must be integers; show your thinking!

This has been posted and answered recently. If you need more help, tell us where you have a problem.

See:
http://www.jiskha.com/display.cgi?id=1253825444

To find all the primes less than 100 that can be expressed in all three ways: p = a^2 + b^2 = c^2 + 2e^2 = f^2 + 3g^2, we need to check whether each prime satisfies these conditions.

Here's the step-by-step process:

1. Generate a list of prime numbers less than 100. For this, we can use a prime number sieve algorithm like the Sieve of Eratosthenes.

2. Starting from the first prime number on the list, check if it can be expressed as p = a^2 + b^2. To do this, iteratively try different combinations of integers a and b, starting from a = 1 and b = 1.

For example, take the prime number 5. We need to check if it can be expressed as 5 = a^2 + b^2.
- Start with a = 1 and b = 1: 1^2 + 1^2 = 2, which is less than 5.
- Increase b to 2: 1^2 + 2^2 = 5, which matches the prime number.

3. Next, check if the prime number can be expressed as p = c^2 + 2e^2. Again, iterate over different values of c and e.

For example, using the prime number 5:
- Start with c = 1 and e = 1: 1^2 + 2*1^2 = 3, which is less than 5.
- Increase e to 2: 1^2 + 2*2^2 = 9, which is greater than 5.
- Try c = 2 and e = 1: 2^2 + 2*1^2 = 6, which is less than 5.
- Increase e to 2: 2^2 + 2*2^2 = 12, which is greater than 5.
- Continue to test with higher values of c and e until finding a match or determining that there isn't one.

4. Finally, check if the prime number can be expressed as p = f^2 + 3g^2. Iterate over different values of f and g.

Using the prime number 5:
- Start with f = 1 and g = 1: 1^2 + 3*1^2 = 4, which is less than 5.
- Increase g to 2: 1^2 + 3*2^2 = 13, which is greater than 5.
- Try f = 2 and g = 1: 2^2 + 3*1^2 = 7, which matches the prime number.
- Continue to test with higher values of f and g until finding a match or determining that there isn't one.

By following this process, we can check each prime number less than 100 and determine whether it can be expressed in all three ways mentioned (p = a^2 + b^2 = c^2 + 2e^2 = f^2 + 3g^2).