Are prime numbers really random?












14












$begingroup$


While practicing to code for my college course I stumbled upon this and would like to know if this is something new or significant as I haven't found anything resembling it on the internet.



$ p_1, p_2, ..., p_n = text{consecutive prime numbers starting from 2} \$



$ q_1 = p_2p_3...p_n \
q_2 = p_1p_3...p_n \
... \
q_n = p_1p_2...p_{n-1} \$



$ r_1 in {1, ..., p_1-1} \
... \
r_n in {1, ..., p_n-1} \$



$ s= p_1p_2...p_n \$



$ x equiv q_1r_1+...+q_nr_n :text{mod}: s \$



$ x_2 = text{the second smallest congruence} \
text{All congruences less than } x_2^2 text{ are also every prime number between } p_n text{ and } x_2^2 \$



$ text{example:} \$



$ p_1, p_2, ..., p_n = 2, 3, 5 \$



$ q_1 = 3cdot5 = 15 \
q_2 = 2cdot5 = 10 \
q_3 = 2cdot3 = 6 \$



$ r_1 in {1} \
r_2 in {1, 2} \
r_3 in {1, 2, 3, 4} \$



$ s = 2cdot3cdot5=30 \$



$ x_2 equiv 7 equiv 15cdot1 +10cdot1 +6cdot2 :text{mod}: 30 \
7^2 = 49 \$



$ text{The full sequence of primes is clearly not random.} \$



$ 0 \
color{blue}{1 equiv 31 equiv 15cdot1 +10cdot1 +6cdot1 :text{mod}: 30} \
1 \
2 \
3 \
4 \
color{red}{5} \$



$ 6 \
color{blue}{7 equiv 37 equiv 15cdot1 +10cdot1 +6cdot2 :text{mod}: 30} \
8 \
9 \
10 \
color{red}{11 equiv 41 equiv 15cdot1 +10cdot2 +6cdot1 :text{mod}: 30} \$



$ 12 \
color{blue}{13 equiv 43 equiv 15cdot1 +10cdot1 +6cdot3 :text{mod}: 30} \
14 \
15 \
16 \
color{red}{17 equiv 47 equiv 15cdot1 +10cdot2 +6cdot2 :text{mod}: 30} \$



$ 18 \
color{blue}{19 equiv 15cdot1 +10cdot1 +6cdot4 :text{mod}: 30} \
20 \
21 \
22 \
color{red}{23 equiv 15cdot1 +10cdot2 +6cdot3 :text{mod}: 30} \$



$ 24 \
color{blue}{25} \
26 \
27 \
28 \
color{red}{29 equiv 15cdot1 +10cdot2 +6cdot4 :text{mod}: 30} \$










share|cite|improve this question









New contributor




user644904 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$








  • 1




    $begingroup$
    Just one question, what do you mean with second smallest congruence?
    $endgroup$
    – Stan Tendijck
    4 hours ago










  • $begingroup$
    @StanTendijck um the second smallest x
    $endgroup$
    – user644904
    4 hours ago








  • 1




    $begingroup$
    @user644904 Pretty interesting observation in my opinion.
    $endgroup$
    – Larry
    4 hours ago








  • 1




    $begingroup$
    I am going to code it up. I'll get back to you in approximately 15 minutes.
    $endgroup$
    – Stan Tendijck
    3 hours ago






  • 1




    $begingroup$
    I believe that this can be setup a bit more cleanly: Let $p_i$ denote the $i$-th prime. For a particular $n$, define $s:=p_1p_2cdots p_n$ and $q_i:=s/p_i$ for $i=1,2,ldots,n$. Let $x_2$ be the second-smallest member of the set $$S = left{sum_{i=1}^n q_i r_i bmod s;middle|; 1 leq r_i < p_i right}$$ From there, you seem to be conjecturing that the members of $S$ in some range are exactly the primes in that range, but I'm not entirely clear on the formulation.
    $endgroup$
    – Blue
    2 hours ago


















14












$begingroup$


While practicing to code for my college course I stumbled upon this and would like to know if this is something new or significant as I haven't found anything resembling it on the internet.



$ p_1, p_2, ..., p_n = text{consecutive prime numbers starting from 2} \$



$ q_1 = p_2p_3...p_n \
q_2 = p_1p_3...p_n \
... \
q_n = p_1p_2...p_{n-1} \$



$ r_1 in {1, ..., p_1-1} \
... \
r_n in {1, ..., p_n-1} \$



$ s= p_1p_2...p_n \$



$ x equiv q_1r_1+...+q_nr_n :text{mod}: s \$



$ x_2 = text{the second smallest congruence} \
text{All congruences less than } x_2^2 text{ are also every prime number between } p_n text{ and } x_2^2 \$



$ text{example:} \$



$ p_1, p_2, ..., p_n = 2, 3, 5 \$



$ q_1 = 3cdot5 = 15 \
q_2 = 2cdot5 = 10 \
q_3 = 2cdot3 = 6 \$



$ r_1 in {1} \
r_2 in {1, 2} \
r_3 in {1, 2, 3, 4} \$



$ s = 2cdot3cdot5=30 \$



$ x_2 equiv 7 equiv 15cdot1 +10cdot1 +6cdot2 :text{mod}: 30 \
7^2 = 49 \$



$ text{The full sequence of primes is clearly not random.} \$



$ 0 \
color{blue}{1 equiv 31 equiv 15cdot1 +10cdot1 +6cdot1 :text{mod}: 30} \
1 \
2 \
3 \
4 \
color{red}{5} \$



$ 6 \
color{blue}{7 equiv 37 equiv 15cdot1 +10cdot1 +6cdot2 :text{mod}: 30} \
8 \
9 \
10 \
color{red}{11 equiv 41 equiv 15cdot1 +10cdot2 +6cdot1 :text{mod}: 30} \$



$ 12 \
color{blue}{13 equiv 43 equiv 15cdot1 +10cdot1 +6cdot3 :text{mod}: 30} \
14 \
15 \
16 \
color{red}{17 equiv 47 equiv 15cdot1 +10cdot2 +6cdot2 :text{mod}: 30} \$



$ 18 \
color{blue}{19 equiv 15cdot1 +10cdot1 +6cdot4 :text{mod}: 30} \
20 \
21 \
22 \
color{red}{23 equiv 15cdot1 +10cdot2 +6cdot3 :text{mod}: 30} \$



$ 24 \
color{blue}{25} \
26 \
27 \
28 \
color{red}{29 equiv 15cdot1 +10cdot2 +6cdot4 :text{mod}: 30} \$










share|cite|improve this question









New contributor




user644904 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$








  • 1




    $begingroup$
    Just one question, what do you mean with second smallest congruence?
    $endgroup$
    – Stan Tendijck
    4 hours ago










  • $begingroup$
    @StanTendijck um the second smallest x
    $endgroup$
    – user644904
    4 hours ago








  • 1




    $begingroup$
    @user644904 Pretty interesting observation in my opinion.
    $endgroup$
    – Larry
    4 hours ago








  • 1




    $begingroup$
    I am going to code it up. I'll get back to you in approximately 15 minutes.
    $endgroup$
    – Stan Tendijck
    3 hours ago






  • 1




    $begingroup$
    I believe that this can be setup a bit more cleanly: Let $p_i$ denote the $i$-th prime. For a particular $n$, define $s:=p_1p_2cdots p_n$ and $q_i:=s/p_i$ for $i=1,2,ldots,n$. Let $x_2$ be the second-smallest member of the set $$S = left{sum_{i=1}^n q_i r_i bmod s;middle|; 1 leq r_i < p_i right}$$ From there, you seem to be conjecturing that the members of $S$ in some range are exactly the primes in that range, but I'm not entirely clear on the formulation.
    $endgroup$
    – Blue
    2 hours ago
















14












14








14


12



$begingroup$


While practicing to code for my college course I stumbled upon this and would like to know if this is something new or significant as I haven't found anything resembling it on the internet.



$ p_1, p_2, ..., p_n = text{consecutive prime numbers starting from 2} \$



$ q_1 = p_2p_3...p_n \
q_2 = p_1p_3...p_n \
... \
q_n = p_1p_2...p_{n-1} \$



$ r_1 in {1, ..., p_1-1} \
... \
r_n in {1, ..., p_n-1} \$



$ s= p_1p_2...p_n \$



$ x equiv q_1r_1+...+q_nr_n :text{mod}: s \$



$ x_2 = text{the second smallest congruence} \
text{All congruences less than } x_2^2 text{ are also every prime number between } p_n text{ and } x_2^2 \$



$ text{example:} \$



$ p_1, p_2, ..., p_n = 2, 3, 5 \$



$ q_1 = 3cdot5 = 15 \
q_2 = 2cdot5 = 10 \
q_3 = 2cdot3 = 6 \$



$ r_1 in {1} \
r_2 in {1, 2} \
r_3 in {1, 2, 3, 4} \$



$ s = 2cdot3cdot5=30 \$



$ x_2 equiv 7 equiv 15cdot1 +10cdot1 +6cdot2 :text{mod}: 30 \
7^2 = 49 \$



$ text{The full sequence of primes is clearly not random.} \$



$ 0 \
color{blue}{1 equiv 31 equiv 15cdot1 +10cdot1 +6cdot1 :text{mod}: 30} \
1 \
2 \
3 \
4 \
color{red}{5} \$



$ 6 \
color{blue}{7 equiv 37 equiv 15cdot1 +10cdot1 +6cdot2 :text{mod}: 30} \
8 \
9 \
10 \
color{red}{11 equiv 41 equiv 15cdot1 +10cdot2 +6cdot1 :text{mod}: 30} \$



$ 12 \
color{blue}{13 equiv 43 equiv 15cdot1 +10cdot1 +6cdot3 :text{mod}: 30} \
14 \
15 \
16 \
color{red}{17 equiv 47 equiv 15cdot1 +10cdot2 +6cdot2 :text{mod}: 30} \$



$ 18 \
color{blue}{19 equiv 15cdot1 +10cdot1 +6cdot4 :text{mod}: 30} \
20 \
21 \
22 \
color{red}{23 equiv 15cdot1 +10cdot2 +6cdot3 :text{mod}: 30} \$



$ 24 \
color{blue}{25} \
26 \
27 \
28 \
color{red}{29 equiv 15cdot1 +10cdot2 +6cdot4 :text{mod}: 30} \$










share|cite|improve this question









New contributor




user644904 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$




While practicing to code for my college course I stumbled upon this and would like to know if this is something new or significant as I haven't found anything resembling it on the internet.



$ p_1, p_2, ..., p_n = text{consecutive prime numbers starting from 2} \$



$ q_1 = p_2p_3...p_n \
q_2 = p_1p_3...p_n \
... \
q_n = p_1p_2...p_{n-1} \$



$ r_1 in {1, ..., p_1-1} \
... \
r_n in {1, ..., p_n-1} \$



$ s= p_1p_2...p_n \$



$ x equiv q_1r_1+...+q_nr_n :text{mod}: s \$



$ x_2 = text{the second smallest congruence} \
text{All congruences less than } x_2^2 text{ are also every prime number between } p_n text{ and } x_2^2 \$



$ text{example:} \$



$ p_1, p_2, ..., p_n = 2, 3, 5 \$



$ q_1 = 3cdot5 = 15 \
q_2 = 2cdot5 = 10 \
q_3 = 2cdot3 = 6 \$



$ r_1 in {1} \
r_2 in {1, 2} \
r_3 in {1, 2, 3, 4} \$



$ s = 2cdot3cdot5=30 \$



$ x_2 equiv 7 equiv 15cdot1 +10cdot1 +6cdot2 :text{mod}: 30 \
7^2 = 49 \$



$ text{The full sequence of primes is clearly not random.} \$



$ 0 \
color{blue}{1 equiv 31 equiv 15cdot1 +10cdot1 +6cdot1 :text{mod}: 30} \
1 \
2 \
3 \
4 \
color{red}{5} \$



$ 6 \
color{blue}{7 equiv 37 equiv 15cdot1 +10cdot1 +6cdot2 :text{mod}: 30} \
8 \
9 \
10 \
color{red}{11 equiv 41 equiv 15cdot1 +10cdot2 +6cdot1 :text{mod}: 30} \$



$ 12 \
color{blue}{13 equiv 43 equiv 15cdot1 +10cdot1 +6cdot3 :text{mod}: 30} \
14 \
15 \
16 \
color{red}{17 equiv 47 equiv 15cdot1 +10cdot2 +6cdot2 :text{mod}: 30} \$



$ 18 \
color{blue}{19 equiv 15cdot1 +10cdot1 +6cdot4 :text{mod}: 30} \
20 \
21 \
22 \
color{red}{23 equiv 15cdot1 +10cdot2 +6cdot3 :text{mod}: 30} \$



$ 24 \
color{blue}{25} \
26 \
27 \
28 \
color{red}{29 equiv 15cdot1 +10cdot2 +6cdot4 :text{mod}: 30} \$







prime-numbers modular-arithmetic






share|cite|improve this question









New contributor




user644904 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|cite|improve this question









New contributor




user644904 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|cite|improve this question




share|cite|improve this question








edited 2 hours ago







user644904













New contributor




user644904 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 4 hours ago









user644904user644904

714




714




New contributor




user644904 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





user644904 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






user644904 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








  • 1




    $begingroup$
    Just one question, what do you mean with second smallest congruence?
    $endgroup$
    – Stan Tendijck
    4 hours ago










  • $begingroup$
    @StanTendijck um the second smallest x
    $endgroup$
    – user644904
    4 hours ago








  • 1




    $begingroup$
    @user644904 Pretty interesting observation in my opinion.
    $endgroup$
    – Larry
    4 hours ago








  • 1




    $begingroup$
    I am going to code it up. I'll get back to you in approximately 15 minutes.
    $endgroup$
    – Stan Tendijck
    3 hours ago






  • 1




    $begingroup$
    I believe that this can be setup a bit more cleanly: Let $p_i$ denote the $i$-th prime. For a particular $n$, define $s:=p_1p_2cdots p_n$ and $q_i:=s/p_i$ for $i=1,2,ldots,n$. Let $x_2$ be the second-smallest member of the set $$S = left{sum_{i=1}^n q_i r_i bmod s;middle|; 1 leq r_i < p_i right}$$ From there, you seem to be conjecturing that the members of $S$ in some range are exactly the primes in that range, but I'm not entirely clear on the formulation.
    $endgroup$
    – Blue
    2 hours ago
















  • 1




    $begingroup$
    Just one question, what do you mean with second smallest congruence?
    $endgroup$
    – Stan Tendijck
    4 hours ago










  • $begingroup$
    @StanTendijck um the second smallest x
    $endgroup$
    – user644904
    4 hours ago








  • 1




    $begingroup$
    @user644904 Pretty interesting observation in my opinion.
    $endgroup$
    – Larry
    4 hours ago








  • 1




    $begingroup$
    I am going to code it up. I'll get back to you in approximately 15 minutes.
    $endgroup$
    – Stan Tendijck
    3 hours ago






  • 1




    $begingroup$
    I believe that this can be setup a bit more cleanly: Let $p_i$ denote the $i$-th prime. For a particular $n$, define $s:=p_1p_2cdots p_n$ and $q_i:=s/p_i$ for $i=1,2,ldots,n$. Let $x_2$ be the second-smallest member of the set $$S = left{sum_{i=1}^n q_i r_i bmod s;middle|; 1 leq r_i < p_i right}$$ From there, you seem to be conjecturing that the members of $S$ in some range are exactly the primes in that range, but I'm not entirely clear on the formulation.
    $endgroup$
    – Blue
    2 hours ago










1




1




$begingroup$
Just one question, what do you mean with second smallest congruence?
$endgroup$
– Stan Tendijck
4 hours ago




$begingroup$
Just one question, what do you mean with second smallest congruence?
$endgroup$
– Stan Tendijck
4 hours ago












$begingroup$
@StanTendijck um the second smallest x
$endgroup$
– user644904
4 hours ago






$begingroup$
@StanTendijck um the second smallest x
$endgroup$
– user644904
4 hours ago






1




1




$begingroup$
@user644904 Pretty interesting observation in my opinion.
$endgroup$
– Larry
4 hours ago






$begingroup$
@user644904 Pretty interesting observation in my opinion.
$endgroup$
– Larry
4 hours ago






1




1




$begingroup$
I am going to code it up. I'll get back to you in approximately 15 minutes.
$endgroup$
– Stan Tendijck
3 hours ago




$begingroup$
I am going to code it up. I'll get back to you in approximately 15 minutes.
$endgroup$
– Stan Tendijck
3 hours ago




1




1




$begingroup$
I believe that this can be setup a bit more cleanly: Let $p_i$ denote the $i$-th prime. For a particular $n$, define $s:=p_1p_2cdots p_n$ and $q_i:=s/p_i$ for $i=1,2,ldots,n$. Let $x_2$ be the second-smallest member of the set $$S = left{sum_{i=1}^n q_i r_i bmod s;middle|; 1 leq r_i < p_i right}$$ From there, you seem to be conjecturing that the members of $S$ in some range are exactly the primes in that range, but I'm not entirely clear on the formulation.
$endgroup$
– Blue
2 hours ago






$begingroup$
I believe that this can be setup a bit more cleanly: Let $p_i$ denote the $i$-th prime. For a particular $n$, define $s:=p_1p_2cdots p_n$ and $q_i:=s/p_i$ for $i=1,2,ldots,n$. Let $x_2$ be the second-smallest member of the set $$S = left{sum_{i=1}^n q_i r_i bmod s;middle|; 1 leq r_i < p_i right}$$ From there, you seem to be conjecturing that the members of $S$ in some range are exactly the primes in that range, but I'm not entirely clear on the formulation.
$endgroup$
– Blue
2 hours ago












2 Answers
2






active

oldest

votes


















1












$begingroup$

Interesting that you marked 25, which is not a prime, similar to 6x+1 and 6x-1, which means it's not a primality test, but still quite interesting.






share|cite|improve this answer











$endgroup$













  • $begingroup$
    Yeah, but I can't comment (need 50 reputation), so I posted it here.
    $endgroup$
    – James
    3 hours ago










  • $begingroup$
    Its not a primality test
    $endgroup$
    – user644904
    2 hours ago










  • $begingroup$
    I didn't say you meant it to be, I'm just pointing out it's not unique to only prime numbers.
    $endgroup$
    – James
    2 hours ago












  • $begingroup$
    Yes you're correct
    $endgroup$
    – user644904
    2 hours ago






  • 2




    $begingroup$
    If it was unique to prime numbers, then this would be ground-breaking.
    $endgroup$
    – James
    2 hours ago



















1












$begingroup$

I had to say, I was suspicious when I read the question but I coded up the problem and up to at least $n=10$ it definitely works.



Edit: I found a proof! It works. Check out the details below.



The proof consists of two main steps: we first prove that the sum $r_1 q_1 + cdots + r_n q_n$ can never be divided by $p_i$ for any $i$ between $1$ and $n$. After that, we will show that $x_2 = p_{n+1}$.



To prove the first part, let's first forget about the modulo $p_1p_2cdots p_n$ term for a moment. Now, note that both $q_i$ and $r_i$ are not divisible by $p_i$ and all other $q_i$ are divisible by $p_i$. Hence, our sum
$$r_1q_1 + cdots + r_n q_n = r_i q_i (neq 0) mod p_i$$ can never be divisible by $p_i$. Adding a multiple of $p_1cdots p_n$ (which is divisible by $p_i$) doesn't change this fact. Hence, $$Big(r_1 q_1 + cdots + r_n q_nmod (p_1cdots p_n)Big) neq 0 mod p_i$$
for any $i$ between $1$ and $n$. Summarizing, the first $n$ primes $p_1$, $p_2$, $dots$ ,$p_n$ will never be divisors of our sum. Now, the question remains: might it be divisible by $p_{n+1}$ for example? We cannot exclude this! But this does wrap up the first part of the proof.




Lemma There exist choices $(r_1,dots,r_n)$ and $(r_1',dots,r_n')$ such
that $$ r_1 q_1 + cdots + r_n q_n = 1mod (p_1p_2cdots p_n) $$ and
$$ r_1 q_1 + cdots + r_n q_n = p_{n+1}mod (p_1p_2cdots p_n). $$




Proof This lemma is actually an application of the Chinese Remainder Theorem. This theorem states that given a sequence $$(a_1,dots,a_n)in prod_{i=1}^{n}mathbb{F}_{p_i}$$
is uniquely related to an $ainmathbb{F}_{prod_{i=1}^{n} p_i}$ where I use the notation $mathbb{F}_z$ to represent the group related to calculating modulo $z$.



We actually know that $(1,1,dots,1)$ is related to $1$ but we don't know exactly what is the sequence which is related to $p_{n+1}$. It turns out it is not necessary to know this sequence to proof its existence! Let's take now arbitrary values $z_1,dots,z_n$ which satisfy the same conditions as the $r_i$, $r_i'$. Let's simplify our expression now modulo $p_i$
$$ z_1 q_1 + cdots + z_n q_n = z_i q_i mod p_i $$
Since $p_i$ is prime, we know that $c q_i$ for $cin{1,dots,p_i-1}$ actually generates the complete group, i.e., $$ {c q_i mod p_i: cin{1,dots,p_i-1}} = {1,2,dots,p_i-1}.$$ This essentially means that we can make the right-hand side equal to almost any number in $prod_{i=1}^{n}mathbb{F}_{p_i}$. To be precise,
$$ prod_{i=1}^{n}{z_1 q_1 + cdots + z_n q_n mod p_i: forall j: 1leq z_jleq p_j-1} \ = prod_{i=1}^{n}{z_i q_i mod p_i: 1leq z_ileq p_i-1} = prod_{i=1}^{n} (mathbb{F}_{p_i}setminus{0}). $$ A slight adaptation of the standard Chinese Remainder Theorem now gives us that
$$ {z_1 q_1 + cdots + z_n q_n mod (p_1cdots p_n): forall j: 1leq z_jleq p_j-1} = mathbb{F}_{prod_{i=1}^{n} p_i}setminus A $$
where $A$ is the set of all multiples of $0, p_1, p_2, dots, p_n$.

Now, let's translate this to English. We see that $1$ is not an element of $A$ and, hence, there exists a sequence $(z_1,dots,z_n)$ such that
$$ z_1 q_1 + cdots + z_n q_n = 1 mod (p_1cdots p_n)$$
and we simply take $r_i = z_i$. Moreover, the next element which is not part of $A$ is $p_{n+1}$ and hence there exist a sequence $(w_1,dots,w_n)$ such that
$$ w_1 q_1 + cdots + w_n q_n = p_{n+1} mod (p_1cdots p_n) $$
and we take $r_i'=w_i$. This completes the proof of the lemma.



Now, we have dealt with the most difficult part and it is not too difficult to finish the proof. For the sake of completeness, let $s = r_1 q_1 + cdots + r_n q_nmod (p_1p_2cdots p_n)$ such that $s< p_{n+1}^2$ and let's assume it is composite. We have proven above that $s$ is not divisible by $p_1, p_2, dots, p_n$. This means that the first candidate prime factor is actually $geq p_{n+1}$. However, since $s$ is composite, it has a second prime factor and this also needs to be $geq p_{n+1}$. Thus $sgeq p_{n+1}^2$ which is a contradiction. This completes the overall proof!



Extra note: we have developed a way of constructing the first $n$ primes. However, since it is not clear how the sequence $(r_1',dots,r_n')$ is chosen in practice, the method is not particularly computationally efficient to put it mildly.






share|cite|improve this answer











$endgroup$













  • $begingroup$
    Thanks for the verification
    $endgroup$
    – user644904
    2 hours ago










  • $begingroup$
    Amazing, but I think I know the pattern for $r$.
    $endgroup$
    – user644904
    1 hour ago










  • $begingroup$
    I apologise in advance for the parcing of the following but these are the patterns for the bigger ones n = 10: (format = (r1,r2,r3,r4,r5,r6,r7,r8,r9,r10)), [(1, 1, 1, 2, 9, 3, 5, 13, 19, 24),31], [(1, 1, 1, 3, 1, 11, 4, 9, 11, 12), 1]. n = 9: [(1, 1, 1, 3, 5, 8, 15, 7, 5), 29][(1, 2, 4, 3, 7, 7, 14, 14, 20),1]. n = 8: [(1, 2, 1, 5, 7, 11, 11, 15), 23] [(1, 1, 2, 6, 7, 5, 16, 18), 1]. n = 7: [(1, 1, 2, 3, 8, 11, 13), 19] [(1, 1, 3, 2, 1, 4, 15), 1]
    $endgroup$
    – Stan Tendijck
    1 hour ago












  • $begingroup$
    I would be amazed if you can confirm your pattern here
    $endgroup$
    – Stan Tendijck
    1 hour ago










  • $begingroup$
    It might have to wait till tomorrow because I have a test in the morning and need some sleep.
    $endgroup$
    – user644904
    1 hour ago











Your Answer





StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});






user644904 is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3113307%2fare-prime-numbers-really-random%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









1












$begingroup$

Interesting that you marked 25, which is not a prime, similar to 6x+1 and 6x-1, which means it's not a primality test, but still quite interesting.






share|cite|improve this answer











$endgroup$













  • $begingroup$
    Yeah, but I can't comment (need 50 reputation), so I posted it here.
    $endgroup$
    – James
    3 hours ago










  • $begingroup$
    Its not a primality test
    $endgroup$
    – user644904
    2 hours ago










  • $begingroup$
    I didn't say you meant it to be, I'm just pointing out it's not unique to only prime numbers.
    $endgroup$
    – James
    2 hours ago












  • $begingroup$
    Yes you're correct
    $endgroup$
    – user644904
    2 hours ago






  • 2




    $begingroup$
    If it was unique to prime numbers, then this would be ground-breaking.
    $endgroup$
    – James
    2 hours ago
















1












$begingroup$

Interesting that you marked 25, which is not a prime, similar to 6x+1 and 6x-1, which means it's not a primality test, but still quite interesting.






share|cite|improve this answer











$endgroup$













  • $begingroup$
    Yeah, but I can't comment (need 50 reputation), so I posted it here.
    $endgroup$
    – James
    3 hours ago










  • $begingroup$
    Its not a primality test
    $endgroup$
    – user644904
    2 hours ago










  • $begingroup$
    I didn't say you meant it to be, I'm just pointing out it's not unique to only prime numbers.
    $endgroup$
    – James
    2 hours ago












  • $begingroup$
    Yes you're correct
    $endgroup$
    – user644904
    2 hours ago






  • 2




    $begingroup$
    If it was unique to prime numbers, then this would be ground-breaking.
    $endgroup$
    – James
    2 hours ago














1












1








1





$begingroup$

Interesting that you marked 25, which is not a prime, similar to 6x+1 and 6x-1, which means it's not a primality test, but still quite interesting.






share|cite|improve this answer











$endgroup$



Interesting that you marked 25, which is not a prime, similar to 6x+1 and 6x-1, which means it's not a primality test, but still quite interesting.







share|cite|improve this answer














share|cite|improve this answer



share|cite|improve this answer








edited 2 hours ago

























answered 3 hours ago









JamesJames

218




218












  • $begingroup$
    Yeah, but I can't comment (need 50 reputation), so I posted it here.
    $endgroup$
    – James
    3 hours ago










  • $begingroup$
    Its not a primality test
    $endgroup$
    – user644904
    2 hours ago










  • $begingroup$
    I didn't say you meant it to be, I'm just pointing out it's not unique to only prime numbers.
    $endgroup$
    – James
    2 hours ago












  • $begingroup$
    Yes you're correct
    $endgroup$
    – user644904
    2 hours ago






  • 2




    $begingroup$
    If it was unique to prime numbers, then this would be ground-breaking.
    $endgroup$
    – James
    2 hours ago


















  • $begingroup$
    Yeah, but I can't comment (need 50 reputation), so I posted it here.
    $endgroup$
    – James
    3 hours ago










  • $begingroup$
    Its not a primality test
    $endgroup$
    – user644904
    2 hours ago










  • $begingroup$
    I didn't say you meant it to be, I'm just pointing out it's not unique to only prime numbers.
    $endgroup$
    – James
    2 hours ago












  • $begingroup$
    Yes you're correct
    $endgroup$
    – user644904
    2 hours ago






  • 2




    $begingroup$
    If it was unique to prime numbers, then this would be ground-breaking.
    $endgroup$
    – James
    2 hours ago
















$begingroup$
Yeah, but I can't comment (need 50 reputation), so I posted it here.
$endgroup$
– James
3 hours ago




$begingroup$
Yeah, but I can't comment (need 50 reputation), so I posted it here.
$endgroup$
– James
3 hours ago












$begingroup$
Its not a primality test
$endgroup$
– user644904
2 hours ago




$begingroup$
Its not a primality test
$endgroup$
– user644904
2 hours ago












$begingroup$
I didn't say you meant it to be, I'm just pointing out it's not unique to only prime numbers.
$endgroup$
– James
2 hours ago






$begingroup$
I didn't say you meant it to be, I'm just pointing out it's not unique to only prime numbers.
$endgroup$
– James
2 hours ago














$begingroup$
Yes you're correct
$endgroup$
– user644904
2 hours ago




$begingroup$
Yes you're correct
$endgroup$
– user644904
2 hours ago




2




2




$begingroup$
If it was unique to prime numbers, then this would be ground-breaking.
$endgroup$
– James
2 hours ago




$begingroup$
If it was unique to prime numbers, then this would be ground-breaking.
$endgroup$
– James
2 hours ago











1












$begingroup$

I had to say, I was suspicious when I read the question but I coded up the problem and up to at least $n=10$ it definitely works.



Edit: I found a proof! It works. Check out the details below.



The proof consists of two main steps: we first prove that the sum $r_1 q_1 + cdots + r_n q_n$ can never be divided by $p_i$ for any $i$ between $1$ and $n$. After that, we will show that $x_2 = p_{n+1}$.



To prove the first part, let's first forget about the modulo $p_1p_2cdots p_n$ term for a moment. Now, note that both $q_i$ and $r_i$ are not divisible by $p_i$ and all other $q_i$ are divisible by $p_i$. Hence, our sum
$$r_1q_1 + cdots + r_n q_n = r_i q_i (neq 0) mod p_i$$ can never be divisible by $p_i$. Adding a multiple of $p_1cdots p_n$ (which is divisible by $p_i$) doesn't change this fact. Hence, $$Big(r_1 q_1 + cdots + r_n q_nmod (p_1cdots p_n)Big) neq 0 mod p_i$$
for any $i$ between $1$ and $n$. Summarizing, the first $n$ primes $p_1$, $p_2$, $dots$ ,$p_n$ will never be divisors of our sum. Now, the question remains: might it be divisible by $p_{n+1}$ for example? We cannot exclude this! But this does wrap up the first part of the proof.




Lemma There exist choices $(r_1,dots,r_n)$ and $(r_1',dots,r_n')$ such
that $$ r_1 q_1 + cdots + r_n q_n = 1mod (p_1p_2cdots p_n) $$ and
$$ r_1 q_1 + cdots + r_n q_n = p_{n+1}mod (p_1p_2cdots p_n). $$




Proof This lemma is actually an application of the Chinese Remainder Theorem. This theorem states that given a sequence $$(a_1,dots,a_n)in prod_{i=1}^{n}mathbb{F}_{p_i}$$
is uniquely related to an $ainmathbb{F}_{prod_{i=1}^{n} p_i}$ where I use the notation $mathbb{F}_z$ to represent the group related to calculating modulo $z$.



We actually know that $(1,1,dots,1)$ is related to $1$ but we don't know exactly what is the sequence which is related to $p_{n+1}$. It turns out it is not necessary to know this sequence to proof its existence! Let's take now arbitrary values $z_1,dots,z_n$ which satisfy the same conditions as the $r_i$, $r_i'$. Let's simplify our expression now modulo $p_i$
$$ z_1 q_1 + cdots + z_n q_n = z_i q_i mod p_i $$
Since $p_i$ is prime, we know that $c q_i$ for $cin{1,dots,p_i-1}$ actually generates the complete group, i.e., $$ {c q_i mod p_i: cin{1,dots,p_i-1}} = {1,2,dots,p_i-1}.$$ This essentially means that we can make the right-hand side equal to almost any number in $prod_{i=1}^{n}mathbb{F}_{p_i}$. To be precise,
$$ prod_{i=1}^{n}{z_1 q_1 + cdots + z_n q_n mod p_i: forall j: 1leq z_jleq p_j-1} \ = prod_{i=1}^{n}{z_i q_i mod p_i: 1leq z_ileq p_i-1} = prod_{i=1}^{n} (mathbb{F}_{p_i}setminus{0}). $$ A slight adaptation of the standard Chinese Remainder Theorem now gives us that
$$ {z_1 q_1 + cdots + z_n q_n mod (p_1cdots p_n): forall j: 1leq z_jleq p_j-1} = mathbb{F}_{prod_{i=1}^{n} p_i}setminus A $$
where $A$ is the set of all multiples of $0, p_1, p_2, dots, p_n$.

Now, let's translate this to English. We see that $1$ is not an element of $A$ and, hence, there exists a sequence $(z_1,dots,z_n)$ such that
$$ z_1 q_1 + cdots + z_n q_n = 1 mod (p_1cdots p_n)$$
and we simply take $r_i = z_i$. Moreover, the next element which is not part of $A$ is $p_{n+1}$ and hence there exist a sequence $(w_1,dots,w_n)$ such that
$$ w_1 q_1 + cdots + w_n q_n = p_{n+1} mod (p_1cdots p_n) $$
and we take $r_i'=w_i$. This completes the proof of the lemma.



Now, we have dealt with the most difficult part and it is not too difficult to finish the proof. For the sake of completeness, let $s = r_1 q_1 + cdots + r_n q_nmod (p_1p_2cdots p_n)$ such that $s< p_{n+1}^2$ and let's assume it is composite. We have proven above that $s$ is not divisible by $p_1, p_2, dots, p_n$. This means that the first candidate prime factor is actually $geq p_{n+1}$. However, since $s$ is composite, it has a second prime factor and this also needs to be $geq p_{n+1}$. Thus $sgeq p_{n+1}^2$ which is a contradiction. This completes the overall proof!



Extra note: we have developed a way of constructing the first $n$ primes. However, since it is not clear how the sequence $(r_1',dots,r_n')$ is chosen in practice, the method is not particularly computationally efficient to put it mildly.






share|cite|improve this answer











$endgroup$













  • $begingroup$
    Thanks for the verification
    $endgroup$
    – user644904
    2 hours ago










  • $begingroup$
    Amazing, but I think I know the pattern for $r$.
    $endgroup$
    – user644904
    1 hour ago










  • $begingroup$
    I apologise in advance for the parcing of the following but these are the patterns for the bigger ones n = 10: (format = (r1,r2,r3,r4,r5,r6,r7,r8,r9,r10)), [(1, 1, 1, 2, 9, 3, 5, 13, 19, 24),31], [(1, 1, 1, 3, 1, 11, 4, 9, 11, 12), 1]. n = 9: [(1, 1, 1, 3, 5, 8, 15, 7, 5), 29][(1, 2, 4, 3, 7, 7, 14, 14, 20),1]. n = 8: [(1, 2, 1, 5, 7, 11, 11, 15), 23] [(1, 1, 2, 6, 7, 5, 16, 18), 1]. n = 7: [(1, 1, 2, 3, 8, 11, 13), 19] [(1, 1, 3, 2, 1, 4, 15), 1]
    $endgroup$
    – Stan Tendijck
    1 hour ago












  • $begingroup$
    I would be amazed if you can confirm your pattern here
    $endgroup$
    – Stan Tendijck
    1 hour ago










  • $begingroup$
    It might have to wait till tomorrow because I have a test in the morning and need some sleep.
    $endgroup$
    – user644904
    1 hour ago
















1












$begingroup$

I had to say, I was suspicious when I read the question but I coded up the problem and up to at least $n=10$ it definitely works.



Edit: I found a proof! It works. Check out the details below.



The proof consists of two main steps: we first prove that the sum $r_1 q_1 + cdots + r_n q_n$ can never be divided by $p_i$ for any $i$ between $1$ and $n$. After that, we will show that $x_2 = p_{n+1}$.



To prove the first part, let's first forget about the modulo $p_1p_2cdots p_n$ term for a moment. Now, note that both $q_i$ and $r_i$ are not divisible by $p_i$ and all other $q_i$ are divisible by $p_i$. Hence, our sum
$$r_1q_1 + cdots + r_n q_n = r_i q_i (neq 0) mod p_i$$ can never be divisible by $p_i$. Adding a multiple of $p_1cdots p_n$ (which is divisible by $p_i$) doesn't change this fact. Hence, $$Big(r_1 q_1 + cdots + r_n q_nmod (p_1cdots p_n)Big) neq 0 mod p_i$$
for any $i$ between $1$ and $n$. Summarizing, the first $n$ primes $p_1$, $p_2$, $dots$ ,$p_n$ will never be divisors of our sum. Now, the question remains: might it be divisible by $p_{n+1}$ for example? We cannot exclude this! But this does wrap up the first part of the proof.




Lemma There exist choices $(r_1,dots,r_n)$ and $(r_1',dots,r_n')$ such
that $$ r_1 q_1 + cdots + r_n q_n = 1mod (p_1p_2cdots p_n) $$ and
$$ r_1 q_1 + cdots + r_n q_n = p_{n+1}mod (p_1p_2cdots p_n). $$




Proof This lemma is actually an application of the Chinese Remainder Theorem. This theorem states that given a sequence $$(a_1,dots,a_n)in prod_{i=1}^{n}mathbb{F}_{p_i}$$
is uniquely related to an $ainmathbb{F}_{prod_{i=1}^{n} p_i}$ where I use the notation $mathbb{F}_z$ to represent the group related to calculating modulo $z$.



We actually know that $(1,1,dots,1)$ is related to $1$ but we don't know exactly what is the sequence which is related to $p_{n+1}$. It turns out it is not necessary to know this sequence to proof its existence! Let's take now arbitrary values $z_1,dots,z_n$ which satisfy the same conditions as the $r_i$, $r_i'$. Let's simplify our expression now modulo $p_i$
$$ z_1 q_1 + cdots + z_n q_n = z_i q_i mod p_i $$
Since $p_i$ is prime, we know that $c q_i$ for $cin{1,dots,p_i-1}$ actually generates the complete group, i.e., $$ {c q_i mod p_i: cin{1,dots,p_i-1}} = {1,2,dots,p_i-1}.$$ This essentially means that we can make the right-hand side equal to almost any number in $prod_{i=1}^{n}mathbb{F}_{p_i}$. To be precise,
$$ prod_{i=1}^{n}{z_1 q_1 + cdots + z_n q_n mod p_i: forall j: 1leq z_jleq p_j-1} \ = prod_{i=1}^{n}{z_i q_i mod p_i: 1leq z_ileq p_i-1} = prod_{i=1}^{n} (mathbb{F}_{p_i}setminus{0}). $$ A slight adaptation of the standard Chinese Remainder Theorem now gives us that
$$ {z_1 q_1 + cdots + z_n q_n mod (p_1cdots p_n): forall j: 1leq z_jleq p_j-1} = mathbb{F}_{prod_{i=1}^{n} p_i}setminus A $$
where $A$ is the set of all multiples of $0, p_1, p_2, dots, p_n$.

Now, let's translate this to English. We see that $1$ is not an element of $A$ and, hence, there exists a sequence $(z_1,dots,z_n)$ such that
$$ z_1 q_1 + cdots + z_n q_n = 1 mod (p_1cdots p_n)$$
and we simply take $r_i = z_i$. Moreover, the next element which is not part of $A$ is $p_{n+1}$ and hence there exist a sequence $(w_1,dots,w_n)$ such that
$$ w_1 q_1 + cdots + w_n q_n = p_{n+1} mod (p_1cdots p_n) $$
and we take $r_i'=w_i$. This completes the proof of the lemma.



Now, we have dealt with the most difficult part and it is not too difficult to finish the proof. For the sake of completeness, let $s = r_1 q_1 + cdots + r_n q_nmod (p_1p_2cdots p_n)$ such that $s< p_{n+1}^2$ and let's assume it is composite. We have proven above that $s$ is not divisible by $p_1, p_2, dots, p_n$. This means that the first candidate prime factor is actually $geq p_{n+1}$. However, since $s$ is composite, it has a second prime factor and this also needs to be $geq p_{n+1}$. Thus $sgeq p_{n+1}^2$ which is a contradiction. This completes the overall proof!



Extra note: we have developed a way of constructing the first $n$ primes. However, since it is not clear how the sequence $(r_1',dots,r_n')$ is chosen in practice, the method is not particularly computationally efficient to put it mildly.






share|cite|improve this answer











$endgroup$













  • $begingroup$
    Thanks for the verification
    $endgroup$
    – user644904
    2 hours ago










  • $begingroup$
    Amazing, but I think I know the pattern for $r$.
    $endgroup$
    – user644904
    1 hour ago










  • $begingroup$
    I apologise in advance for the parcing of the following but these are the patterns for the bigger ones n = 10: (format = (r1,r2,r3,r4,r5,r6,r7,r8,r9,r10)), [(1, 1, 1, 2, 9, 3, 5, 13, 19, 24),31], [(1, 1, 1, 3, 1, 11, 4, 9, 11, 12), 1]. n = 9: [(1, 1, 1, 3, 5, 8, 15, 7, 5), 29][(1, 2, 4, 3, 7, 7, 14, 14, 20),1]. n = 8: [(1, 2, 1, 5, 7, 11, 11, 15), 23] [(1, 1, 2, 6, 7, 5, 16, 18), 1]. n = 7: [(1, 1, 2, 3, 8, 11, 13), 19] [(1, 1, 3, 2, 1, 4, 15), 1]
    $endgroup$
    – Stan Tendijck
    1 hour ago












  • $begingroup$
    I would be amazed if you can confirm your pattern here
    $endgroup$
    – Stan Tendijck
    1 hour ago










  • $begingroup$
    It might have to wait till tomorrow because I have a test in the morning and need some sleep.
    $endgroup$
    – user644904
    1 hour ago














1












1








1





$begingroup$

I had to say, I was suspicious when I read the question but I coded up the problem and up to at least $n=10$ it definitely works.



Edit: I found a proof! It works. Check out the details below.



The proof consists of two main steps: we first prove that the sum $r_1 q_1 + cdots + r_n q_n$ can never be divided by $p_i$ for any $i$ between $1$ and $n$. After that, we will show that $x_2 = p_{n+1}$.



To prove the first part, let's first forget about the modulo $p_1p_2cdots p_n$ term for a moment. Now, note that both $q_i$ and $r_i$ are not divisible by $p_i$ and all other $q_i$ are divisible by $p_i$. Hence, our sum
$$r_1q_1 + cdots + r_n q_n = r_i q_i (neq 0) mod p_i$$ can never be divisible by $p_i$. Adding a multiple of $p_1cdots p_n$ (which is divisible by $p_i$) doesn't change this fact. Hence, $$Big(r_1 q_1 + cdots + r_n q_nmod (p_1cdots p_n)Big) neq 0 mod p_i$$
for any $i$ between $1$ and $n$. Summarizing, the first $n$ primes $p_1$, $p_2$, $dots$ ,$p_n$ will never be divisors of our sum. Now, the question remains: might it be divisible by $p_{n+1}$ for example? We cannot exclude this! But this does wrap up the first part of the proof.




Lemma There exist choices $(r_1,dots,r_n)$ and $(r_1',dots,r_n')$ such
that $$ r_1 q_1 + cdots + r_n q_n = 1mod (p_1p_2cdots p_n) $$ and
$$ r_1 q_1 + cdots + r_n q_n = p_{n+1}mod (p_1p_2cdots p_n). $$




Proof This lemma is actually an application of the Chinese Remainder Theorem. This theorem states that given a sequence $$(a_1,dots,a_n)in prod_{i=1}^{n}mathbb{F}_{p_i}$$
is uniquely related to an $ainmathbb{F}_{prod_{i=1}^{n} p_i}$ where I use the notation $mathbb{F}_z$ to represent the group related to calculating modulo $z$.



We actually know that $(1,1,dots,1)$ is related to $1$ but we don't know exactly what is the sequence which is related to $p_{n+1}$. It turns out it is not necessary to know this sequence to proof its existence! Let's take now arbitrary values $z_1,dots,z_n$ which satisfy the same conditions as the $r_i$, $r_i'$. Let's simplify our expression now modulo $p_i$
$$ z_1 q_1 + cdots + z_n q_n = z_i q_i mod p_i $$
Since $p_i$ is prime, we know that $c q_i$ for $cin{1,dots,p_i-1}$ actually generates the complete group, i.e., $$ {c q_i mod p_i: cin{1,dots,p_i-1}} = {1,2,dots,p_i-1}.$$ This essentially means that we can make the right-hand side equal to almost any number in $prod_{i=1}^{n}mathbb{F}_{p_i}$. To be precise,
$$ prod_{i=1}^{n}{z_1 q_1 + cdots + z_n q_n mod p_i: forall j: 1leq z_jleq p_j-1} \ = prod_{i=1}^{n}{z_i q_i mod p_i: 1leq z_ileq p_i-1} = prod_{i=1}^{n} (mathbb{F}_{p_i}setminus{0}). $$ A slight adaptation of the standard Chinese Remainder Theorem now gives us that
$$ {z_1 q_1 + cdots + z_n q_n mod (p_1cdots p_n): forall j: 1leq z_jleq p_j-1} = mathbb{F}_{prod_{i=1}^{n} p_i}setminus A $$
where $A$ is the set of all multiples of $0, p_1, p_2, dots, p_n$.

Now, let's translate this to English. We see that $1$ is not an element of $A$ and, hence, there exists a sequence $(z_1,dots,z_n)$ such that
$$ z_1 q_1 + cdots + z_n q_n = 1 mod (p_1cdots p_n)$$
and we simply take $r_i = z_i$. Moreover, the next element which is not part of $A$ is $p_{n+1}$ and hence there exist a sequence $(w_1,dots,w_n)$ such that
$$ w_1 q_1 + cdots + w_n q_n = p_{n+1} mod (p_1cdots p_n) $$
and we take $r_i'=w_i$. This completes the proof of the lemma.



Now, we have dealt with the most difficult part and it is not too difficult to finish the proof. For the sake of completeness, let $s = r_1 q_1 + cdots + r_n q_nmod (p_1p_2cdots p_n)$ such that $s< p_{n+1}^2$ and let's assume it is composite. We have proven above that $s$ is not divisible by $p_1, p_2, dots, p_n$. This means that the first candidate prime factor is actually $geq p_{n+1}$. However, since $s$ is composite, it has a second prime factor and this also needs to be $geq p_{n+1}$. Thus $sgeq p_{n+1}^2$ which is a contradiction. This completes the overall proof!



Extra note: we have developed a way of constructing the first $n$ primes. However, since it is not clear how the sequence $(r_1',dots,r_n')$ is chosen in practice, the method is not particularly computationally efficient to put it mildly.






share|cite|improve this answer











$endgroup$



I had to say, I was suspicious when I read the question but I coded up the problem and up to at least $n=10$ it definitely works.



Edit: I found a proof! It works. Check out the details below.



The proof consists of two main steps: we first prove that the sum $r_1 q_1 + cdots + r_n q_n$ can never be divided by $p_i$ for any $i$ between $1$ and $n$. After that, we will show that $x_2 = p_{n+1}$.



To prove the first part, let's first forget about the modulo $p_1p_2cdots p_n$ term for a moment. Now, note that both $q_i$ and $r_i$ are not divisible by $p_i$ and all other $q_i$ are divisible by $p_i$. Hence, our sum
$$r_1q_1 + cdots + r_n q_n = r_i q_i (neq 0) mod p_i$$ can never be divisible by $p_i$. Adding a multiple of $p_1cdots p_n$ (which is divisible by $p_i$) doesn't change this fact. Hence, $$Big(r_1 q_1 + cdots + r_n q_nmod (p_1cdots p_n)Big) neq 0 mod p_i$$
for any $i$ between $1$ and $n$. Summarizing, the first $n$ primes $p_1$, $p_2$, $dots$ ,$p_n$ will never be divisors of our sum. Now, the question remains: might it be divisible by $p_{n+1}$ for example? We cannot exclude this! But this does wrap up the first part of the proof.




Lemma There exist choices $(r_1,dots,r_n)$ and $(r_1',dots,r_n')$ such
that $$ r_1 q_1 + cdots + r_n q_n = 1mod (p_1p_2cdots p_n) $$ and
$$ r_1 q_1 + cdots + r_n q_n = p_{n+1}mod (p_1p_2cdots p_n). $$




Proof This lemma is actually an application of the Chinese Remainder Theorem. This theorem states that given a sequence $$(a_1,dots,a_n)in prod_{i=1}^{n}mathbb{F}_{p_i}$$
is uniquely related to an $ainmathbb{F}_{prod_{i=1}^{n} p_i}$ where I use the notation $mathbb{F}_z$ to represent the group related to calculating modulo $z$.



We actually know that $(1,1,dots,1)$ is related to $1$ but we don't know exactly what is the sequence which is related to $p_{n+1}$. It turns out it is not necessary to know this sequence to proof its existence! Let's take now arbitrary values $z_1,dots,z_n$ which satisfy the same conditions as the $r_i$, $r_i'$. Let's simplify our expression now modulo $p_i$
$$ z_1 q_1 + cdots + z_n q_n = z_i q_i mod p_i $$
Since $p_i$ is prime, we know that $c q_i$ for $cin{1,dots,p_i-1}$ actually generates the complete group, i.e., $$ {c q_i mod p_i: cin{1,dots,p_i-1}} = {1,2,dots,p_i-1}.$$ This essentially means that we can make the right-hand side equal to almost any number in $prod_{i=1}^{n}mathbb{F}_{p_i}$. To be precise,
$$ prod_{i=1}^{n}{z_1 q_1 + cdots + z_n q_n mod p_i: forall j: 1leq z_jleq p_j-1} \ = prod_{i=1}^{n}{z_i q_i mod p_i: 1leq z_ileq p_i-1} = prod_{i=1}^{n} (mathbb{F}_{p_i}setminus{0}). $$ A slight adaptation of the standard Chinese Remainder Theorem now gives us that
$$ {z_1 q_1 + cdots + z_n q_n mod (p_1cdots p_n): forall j: 1leq z_jleq p_j-1} = mathbb{F}_{prod_{i=1}^{n} p_i}setminus A $$
where $A$ is the set of all multiples of $0, p_1, p_2, dots, p_n$.

Now, let's translate this to English. We see that $1$ is not an element of $A$ and, hence, there exists a sequence $(z_1,dots,z_n)$ such that
$$ z_1 q_1 + cdots + z_n q_n = 1 mod (p_1cdots p_n)$$
and we simply take $r_i = z_i$. Moreover, the next element which is not part of $A$ is $p_{n+1}$ and hence there exist a sequence $(w_1,dots,w_n)$ such that
$$ w_1 q_1 + cdots + w_n q_n = p_{n+1} mod (p_1cdots p_n) $$
and we take $r_i'=w_i$. This completes the proof of the lemma.



Now, we have dealt with the most difficult part and it is not too difficult to finish the proof. For the sake of completeness, let $s = r_1 q_1 + cdots + r_n q_nmod (p_1p_2cdots p_n)$ such that $s< p_{n+1}^2$ and let's assume it is composite. We have proven above that $s$ is not divisible by $p_1, p_2, dots, p_n$. This means that the first candidate prime factor is actually $geq p_{n+1}$. However, since $s$ is composite, it has a second prime factor and this also needs to be $geq p_{n+1}$. Thus $sgeq p_{n+1}^2$ which is a contradiction. This completes the overall proof!



Extra note: we have developed a way of constructing the first $n$ primes. However, since it is not clear how the sequence $(r_1',dots,r_n')$ is chosen in practice, the method is not particularly computationally efficient to put it mildly.







share|cite|improve this answer














share|cite|improve this answer



share|cite|improve this answer








edited 11 mins ago

























answered 3 hours ago









Stan TendijckStan Tendijck

1,541310




1,541310












  • $begingroup$
    Thanks for the verification
    $endgroup$
    – user644904
    2 hours ago










  • $begingroup$
    Amazing, but I think I know the pattern for $r$.
    $endgroup$
    – user644904
    1 hour ago










  • $begingroup$
    I apologise in advance for the parcing of the following but these are the patterns for the bigger ones n = 10: (format = (r1,r2,r3,r4,r5,r6,r7,r8,r9,r10)), [(1, 1, 1, 2, 9, 3, 5, 13, 19, 24),31], [(1, 1, 1, 3, 1, 11, 4, 9, 11, 12), 1]. n = 9: [(1, 1, 1, 3, 5, 8, 15, 7, 5), 29][(1, 2, 4, 3, 7, 7, 14, 14, 20),1]. n = 8: [(1, 2, 1, 5, 7, 11, 11, 15), 23] [(1, 1, 2, 6, 7, 5, 16, 18), 1]. n = 7: [(1, 1, 2, 3, 8, 11, 13), 19] [(1, 1, 3, 2, 1, 4, 15), 1]
    $endgroup$
    – Stan Tendijck
    1 hour ago












  • $begingroup$
    I would be amazed if you can confirm your pattern here
    $endgroup$
    – Stan Tendijck
    1 hour ago










  • $begingroup$
    It might have to wait till tomorrow because I have a test in the morning and need some sleep.
    $endgroup$
    – user644904
    1 hour ago


















  • $begingroup$
    Thanks for the verification
    $endgroup$
    – user644904
    2 hours ago










  • $begingroup$
    Amazing, but I think I know the pattern for $r$.
    $endgroup$
    – user644904
    1 hour ago










  • $begingroup$
    I apologise in advance for the parcing of the following but these are the patterns for the bigger ones n = 10: (format = (r1,r2,r3,r4,r5,r6,r7,r8,r9,r10)), [(1, 1, 1, 2, 9, 3, 5, 13, 19, 24),31], [(1, 1, 1, 3, 1, 11, 4, 9, 11, 12), 1]. n = 9: [(1, 1, 1, 3, 5, 8, 15, 7, 5), 29][(1, 2, 4, 3, 7, 7, 14, 14, 20),1]. n = 8: [(1, 2, 1, 5, 7, 11, 11, 15), 23] [(1, 1, 2, 6, 7, 5, 16, 18), 1]. n = 7: [(1, 1, 2, 3, 8, 11, 13), 19] [(1, 1, 3, 2, 1, 4, 15), 1]
    $endgroup$
    – Stan Tendijck
    1 hour ago












  • $begingroup$
    I would be amazed if you can confirm your pattern here
    $endgroup$
    – Stan Tendijck
    1 hour ago










  • $begingroup$
    It might have to wait till tomorrow because I have a test in the morning and need some sleep.
    $endgroup$
    – user644904
    1 hour ago
















$begingroup$
Thanks for the verification
$endgroup$
– user644904
2 hours ago




$begingroup$
Thanks for the verification
$endgroup$
– user644904
2 hours ago












$begingroup$
Amazing, but I think I know the pattern for $r$.
$endgroup$
– user644904
1 hour ago




$begingroup$
Amazing, but I think I know the pattern for $r$.
$endgroup$
– user644904
1 hour ago












$begingroup$
I apologise in advance for the parcing of the following but these are the patterns for the bigger ones n = 10: (format = (r1,r2,r3,r4,r5,r6,r7,r8,r9,r10)), [(1, 1, 1, 2, 9, 3, 5, 13, 19, 24),31], [(1, 1, 1, 3, 1, 11, 4, 9, 11, 12), 1]. n = 9: [(1, 1, 1, 3, 5, 8, 15, 7, 5), 29][(1, 2, 4, 3, 7, 7, 14, 14, 20),1]. n = 8: [(1, 2, 1, 5, 7, 11, 11, 15), 23] [(1, 1, 2, 6, 7, 5, 16, 18), 1]. n = 7: [(1, 1, 2, 3, 8, 11, 13), 19] [(1, 1, 3, 2, 1, 4, 15), 1]
$endgroup$
– Stan Tendijck
1 hour ago






$begingroup$
I apologise in advance for the parcing of the following but these are the patterns for the bigger ones n = 10: (format = (r1,r2,r3,r4,r5,r6,r7,r8,r9,r10)), [(1, 1, 1, 2, 9, 3, 5, 13, 19, 24),31], [(1, 1, 1, 3, 1, 11, 4, 9, 11, 12), 1]. n = 9: [(1, 1, 1, 3, 5, 8, 15, 7, 5), 29][(1, 2, 4, 3, 7, 7, 14, 14, 20),1]. n = 8: [(1, 2, 1, 5, 7, 11, 11, 15), 23] [(1, 1, 2, 6, 7, 5, 16, 18), 1]. n = 7: [(1, 1, 2, 3, 8, 11, 13), 19] [(1, 1, 3, 2, 1, 4, 15), 1]
$endgroup$
– Stan Tendijck
1 hour ago














$begingroup$
I would be amazed if you can confirm your pattern here
$endgroup$
– Stan Tendijck
1 hour ago




$begingroup$
I would be amazed if you can confirm your pattern here
$endgroup$
– Stan Tendijck
1 hour ago












$begingroup$
It might have to wait till tomorrow because I have a test in the morning and need some sleep.
$endgroup$
– user644904
1 hour ago




$begingroup$
It might have to wait till tomorrow because I have a test in the morning and need some sleep.
$endgroup$
– user644904
1 hour ago










user644904 is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















user644904 is a new contributor. Be nice, and check out our Code of Conduct.













user644904 is a new contributor. Be nice, and check out our Code of Conduct.












user644904 is a new contributor. Be nice, and check out our Code of Conduct.
















Thanks for contributing an answer to Mathematics Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3113307%2fare-prime-numbers-really-random%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

Mangá

Eduardo VII do Reino Unido