<s>[INST] The sum of all integers from $1$ to $p$ is divisible by $p$ and all prime numbers before $p$. What can $p$ be? 
The summation of all integers from $1$ to $p$ is divisible by $p$ and all prime numbers before $p$. Find all possible solutions for $p$, with proof. Here $p$ is a prime number.   

This is a preparation problem for the upcoming BdMO. I can't find a way to start. Any hint will be helpful. 
 [/INST] Let $p_n$ be the $n$-th prime.
By Betrand's Postulate, $p_n < 2^n$ for $n > 1$ and therefore $S_n:=\dfrac{p_n(p_n+1)}{2} < 2^{2n-1} + 2^{n-1} < 2^{2n} = 4^n$.
But $5 < p_n$ for $n > 3$ so $P_n:=\displaystyle\prod_{i=1}^n p_i > 5^{n-1}$ for $n > 3$.
Since $P_n$ must divide $S_n$ then $P_n \leq S_n$, so either $5^{n-1} < 4^n$ and $n > 3$ or $n\leq 3$.
The first case means that $n < 8$ since $5^7 > 4^8$ and thus $5^{n-1} > 4^n$ for $n\geq 8$.
$p_1 = 2$ and $S_1 = 3$ but $2 \leq 2$ and $2\nmid S_1$.
$p_2 = 3$ and $S_2 = 6$ is divisible by $P_2 = 6$. So $p=3$ is a solution.
$p_3 = 5$ and $S_3 = 15$ but $2 < 5$ and $2\nmid S_3$.
$p_4 = 7$ and $S_4 = 28$ but $3 < 7$ and $3\nmid S_4$.
$p_5 = 11$ and $S_5 = 66$ but $7 < 11$ and $7\nmid S_5$.
$p_6 = 13$ and $S_6 = 91$ but $3 < 13$ and $3\nmid S_6$.
$p_7 = 17$ and $S_7 = 153$ but $2 < 17$ and $2\nmid S_7$.
The only solution for $p$ is $3$.
</s>