#Skip to menu

Sum of four primes

First read the problem description.

The Goldbach’s conjecture has been proved up to \(4*10^{18}\), which is enough for our problem. We set p1 = 2 and p2 = 2 if n is even or p2 = 3 if n is odd. So that the sum of p3 >= 3 and p4 >= 3 needs to be even.

Source code of the solution(s):
Tags: ,