# All primes that cannot be be represented as a specific sum

For $n \in N$, $p_i$ prime, for $i \in N$, find all primes such that can be represented as $p_1 p_2\cdots p_n+p_1 p_2\cdots p_{n-1}+p_1 p_2\cdots p_{n-2}+\cdots+ p_1 p_2 + p_1 + 1$.

-
Is $p_i$ the $i$th prime, or can they be chosen arbitrarily? – user11977 Mar 19 '14 at 21:40
$p_i$ is an arbitrary prime. (therefore is the answer below incorrect) – tesgoe Mar 20 '14 at 14:42

These are the partial sums of the primorials, Sloane's A143293. All terms other than 1 are divisible by 3, so 3 is the only prime.

-

Intriguing problem.

Suppose you want to make the sum equal to $N$. Subtract 1 from both sides. The LHS is a multiple of $p_1$, so $p_1$ must be a prime factor of $N-1$. Divide both sides by $p_1$, and now you've left with exactly the same equation as originally, but trying to achieve a value of $(N-1)/p_1$.

So $N$ is expressible iff $(N-1)/p$ is expressible for some $p|N$. As base cases, 1 is expressible, but 2 is not.

If we turn things around, let's look at the set of inexpressible numbers. We start with 2, and can add any number $N$ to the list where $(N-1)/p$ is in the list for all $p|N-1$.

This gives the following sequence:

2, 5, 11, 23, 26, 47, 56, 95, 116, 122, 236, 254, 518, 530, 1082, 2210

Brute forcing with a program shows there are no other elements in the list (we can stop once we get past $2210^2$).

-