Conjectured Primality Test for Repunit Numbers

419 Views Asked by At

How to prove that following conjecture is true?

Definition:

Let $P_m(x)=2^{-m}\cdot \left(\left(x-\sqrt{x^2-4}\right)^{m}+\left(x+\sqrt{x^2-4}\right)^{m}\right)$,

where $m$ and $x$ are nonnegative integers.

Conjecture :

Let $R_p=\frac{10^p-1}{9}$ such that $p \in \mathbb{P}$ and $p \ge 3$ .

Let $S_i=P_{10}(S_{i-1})$ with $S_0=P_{10}(P_{10}(3))$ , thus

$R_p$ is prime iff $S_{p-2} \equiv P_{10}(3) \pmod{R_p}$


You can run this test here .

I have checked this statement for all odd primes $p$ below $3000$ .

Any hint will be greatly appreciated .

1

There are 1 best solutions below

2
On

This is a partial answer.

This answer proves the following :

$$\text{if $R_p$ is prime, then $S_{p-2}\equiv P_{10}(3)\pmod{R_p}$}$$

First of all, we prove by induction that $$S_i=\alpha^{2\cdot 10^{i+2}}+\beta^{2\cdot 10^{i+2}}\tag1$$ where $\alpha=\frac{\sqrt 5-1}{2},\beta=\frac{\sqrt 5+1}{2}$ with $\alpha\beta=1$.

Proof for $(1)$ :

The key here is that $$(\alpha^{m}+\beta^{m})^2-4=(\beta^m-\alpha^m)^2$$ holds because $\alpha\beta=1$.

$$\begin{align}S_0&=P_{10}(P_{10}(3))\\&=P_{10}(\alpha^{20}+\beta^{20})\\&=2^{-10}\left(\left(\alpha^{20}+\beta^{20}-\sqrt{\left(\alpha^{20}+\beta^{20}\right)^2-4}\right)^{10}+\left(\alpha^{20}+\beta^{20}+\sqrt{\left(\alpha^{20}+\beta^{20}\right)^2-4}\right)^{10}\right)\\&=2^{-10}\left(\left(\alpha^{20}+\beta^{20}-\sqrt{\left(\beta^{20}-\alpha^{20}\right)^2}\right)^{10}+\left(\alpha^{20}+\beta^{20}+\sqrt{\left(\beta^{20}-\alpha^{20}\right)^2}\right)^{10}\right)\\&=2^{-10}\left(\left(\alpha^{20}+\beta^{20}-\left(\beta^{20}-\alpha^{20}\right)\right)^{10}+\left(\alpha^{20}+\beta^{20}+\left(\beta^{20}-\alpha^{20}\right)\right)^{10}\right)\\&=2^{-10}\left(\left(2\alpha^{20}\right)^{10}+\left(2\beta^{20}\right)^{10}\right)\\&=\alpha^{2\cdot 10^2}+\beta^{2\cdot 10^2}\end{align}$$

Supposing that $(1)$ holds for $i$ gives $$\small\begin{align}&S_{i+1}\\&=P_{10}(S_i)\\&=P_{10}(\alpha^{2\cdot 10^{i+2}}+\beta^{2\cdot 10^{i+2}})\\&=2^{-10}\left(\alpha^{2\cdot 10^{i+2}}+\beta^{2\cdot 10^{i+2}}-\sqrt{\left(\alpha^{2\cdot 10^{i+2}}+\beta^{2\cdot 10^{i+2}}\right)^2-4}\right)^{10}\\&\qquad+2^{-10}\left(\alpha^{2\cdot 10^{i+2}}+\beta^{2\cdot 10^{i+2}}+\sqrt{\left(\alpha^{2\cdot 10^{i+2}}+\beta^{2\cdot 10^{i+2}}\right)^2-4}\right)^{10}\\&=2^{-10}\left(\left(\alpha^{2\cdot 10^{i+2}}+\beta^{2\cdot 10^{i+2}}-\sqrt{\left(\beta^{2\cdot 10^{i+2}}-\alpha^{2\cdot 10^{i+2}}\right)^2}\right)^{10}+\left(\alpha^{2\cdot 10^{i+2}}+\beta^{2\cdot 10^{i+2}}+\sqrt{\left(\beta^{2\cdot 10^{i+2}}-\alpha^{2\cdot 10^{i+2}}\right)^2}\right)^{10}\right)\\&=2^{-10}\left(\left(\alpha^{2\cdot 10^{i+2}}+\beta^{2\cdot 10^{i+2}}-\left(\beta^{2\cdot 10^{i+2}}-\alpha^{2\cdot 10^{i+2}}\right)\right)^{10}+\left(\alpha^{2\cdot 10^{i+2}}+\beta^{2\cdot 10^{i+2}}+\left(\beta^{2\cdot 10^{i+2}}-\alpha^{2\cdot 10^{i+2}}\right)\right)^{10}\right)\\&=2^{-10}\left(\left(2\alpha^{2\cdot 10^{i+2}}\right)^{10}+\left(2\beta^{2\cdot 10^{i+2}}\right)^{10}\right)\\&=\alpha^{2\cdot 10^{i+3}}+\beta^{2\cdot 10^{i+3}}\quad\blacksquare\end{align}$$

Let $N:=R_p=\frac{10^p-1}{9}$. Then, using $(1)$, the binomial theorem and Fermat's little theorem, $$\begin{align}2^{9N+1}\cdot S_{p-2}&=2^{9N+1}\left(\alpha^{2\cdot 10^{p}}+\beta^{2\cdot 10^{p}}\right)\\&=2^{9N+1}\left(\alpha^{2(9N+1)}+\beta^{2(9N+1)}\right)\\&=2^{9N+1}\left((\alpha^2)^{9N+1}+(\beta^2)^{9N+1}\right)\\&=(3-\sqrt 5)((3-\sqrt 5)^{9})^N+(3+\sqrt 5)((3+\sqrt 5)^9)^N\\&=(3-\sqrt 5)(1479168-661504\sqrt 5)^N+(3+\sqrt 5)(1479168+661504\sqrt 5)^N\\&=3\sum_{i=0}^{N}\binom{N}{i}1479168^{i}\left((-661504\sqrt 5)^{N-i}+(661504\sqrt 5)^{N-i}\right)+\sqrt 5\sum_{i=0}^{N}\binom{N}{i}1479168^i\cdot \left((661504\sqrt 5)^{N-i}-(-661504\sqrt 5)^{N-i}\right)\\&=3\sum_{j=1}^{(N+1)/2}\binom{N}{2j-1}1479168^{2j-1}\cdot 2(661504\sqrt 5)^{N-(2j-1)}+\sqrt 5\sum_{j=0}^{(N-1)/2}\binom{N}{2j}1479168^{2j}\cdot 2(661504\sqrt 5)^{N-2j}\\&\equiv 3\cdot 1479168^{N}\cdot 2+\sqrt 5\cdot 2(661504\sqrt 5)^{N}\quad\pmod N\\&\equiv 6\cdot 1479168^{N}+2\cdot 5^{(N+1)/2}\cdot 661504^{N}\quad\pmod N\\&\equiv 6\cdot (2^9\cdot 3^3\cdot 107)^{N}+2\cdot 5^{(N+1)/2}\cdot (2^{11}\cdot 17\cdot 19)^{N}\quad\pmod N\\&\equiv 6\cdot 2^9\cdot 3^3\cdot 107+2\cdot 5\cdot 2^{11}\cdot 17\cdot 19\quad\pmod N\\&\equiv 2^{10}\left(3^4\cdot 107+2^2\cdot 5\cdot 17\cdot 19\right)\quad\pmod N\\&\equiv 2^{10}\cdot P_{10}(3)\quad\pmod N\end{align}$$ (because $5^{(N-1)/2}\equiv 1\pmod N$) from which $$S_{p-2}\equiv P_{10}(3)\pmod{R_p}$$ follows since $2^{9N+1}\equiv 2^{10}\pmod N$ is coprime to $N$.