# Thread: Sum of prime numbers

1. ## Sum of prime numbers

What is the sum of all prime numbers p such that : 8p+120 is a triangle number. A triangle number is a number in the form (n(n+1))/2.

Any hints? Thanx.

2. ## Re: Sum of prime numbers

Was googling your problem and came across this:

It turns out that there are only 2 primes that
satisfy 8p+120 = a triangular number.
Clearly, p = 2 works:
16+120 = 136 = 16*17/2.
We will show that the only other value of p
that works is p = 47.
Thus the sum of all the required primes is 49.
We need the following result:
If n is a triangular number then 8n+1 is a square.
So we can write the condition of the problem as
64p + 961 = x^2
or
(x+31)(x-31) = 64p.
Suppose p = 2
Since x > 31 we have x -31 = 2
x = 33, 128 + 961 = 1089 = 33^2.
So let's assume p is an odd prime
Then, because p is prime, we must have
one of the following:
a. x-31 = 32, x+31 = 2p
Then x = 63, 63+31 = 94
94*32 + 961 = 3969, a square.
So p = 47. 8p+120 = 496 = 31*32/2.
b. x-31 = 16, x+31 = 4p
x = 47. 47+31 = 78, but
78 is not of the form 4p.
c). x-31 = 8. x+31 = 8p
x = 39, 39+31 = 70,
but 70 is not of the form 8p.
Similarly, the remaining 2 cases are impossible.
The answer to the problem is therefore 49.