The minimal combination $\big|\pm p_1\pm\dots\pm p_n\big|$ for primes

90 Views Asked by At

Conjecture:
The minimal combination $\big|\pm p_1\pm\dots\pm p_n\big|$ is $0$ for odd $n>1$ and $1$ for even $n$, where $p_n$ is the $n$-th prime.

Tested for $n\leq 17$ by me and for $n\leq 28$ by user AugSB.


$\min \big|\pm p_1\pm\dots\pm p_n\big|=\frac{1}{2}\big(1+(-1)^n\big)$, if $n>1$.

1

There are 1 best solutions below

0
On BEST ANSWER

Using Bertrand's postulate, for any $n \ge 1$, $p_n<p_{n+1}<2p_n$. Using this I'll prove (by induction) :

Lemma : Denoting $S_n := \Big \{ \sum \limits_{k=1}^n \varepsilon_k p_k \ |\ (\varepsilon_1,...,\varepsilon_n) \in \{-1,1\}^n \Big \}$, for $n \ge 6$, if $n$ is even (resp. odd), then $S_n$ contains all odd (resp. even) integers in $[\![-2p_n,2p_n]\!]$.

$ $

Base case : if I'm not mistaken, $S_6$ contains $-25,-23,...,23,25$.

Induction : assume the lemma to hold for some $n \ge 6$. I'll use that $\pm p_{n+1} + S_n \subset S_{n+1}$.

  • if $n$ is odd : $S_n$ contains all even integers in $[\![-2p_n,2p_n]\!]$, and as $p_{n+1}$ is odd, $S_{n+1}$ contains all odd integers in $[\![-2p_n+p_{n+1},2p_n+p_{n+1}]\!]$, so by Bertrand's postulate, $S_{n+1}$ contains all odd integers in $[\![0,2p_{n+1}]\!]$. Similarly $S_{n+1}$ contains all odd integers in $[\![-2p_{n+1},0]\!]$.

  • if $n$ is even, $S_n$ contains many odd integers, and $p_{n+1}$ is odd, so we find that $S_{n+1}$ contains many even integers (same thing as above). The lemma holds for $n+1$.

$ $

Hence for $n$ odd, $S_n$ contains $0$, and for $n$ even, $S_n$ contains $1$, which proves the conjecture.