Here is what I observed :
Inspired by Lucas-Lehmer primality test, I think I made a primality test for numbers of the form $\frac{a^p-1}{a-1}$ but the test isn't perfect and there are some conditions to apply :
- $a$ must not be a perfect power otherwise you can get false positive.
- $p$ must be a prime number $\ge 3$ otherwise you can "break" the primality test and get false positive.
Interestingly the test passes some strong pseudoprimes, Poulet number, Carmichael number or Wieferich primes.
Let $N = \frac{a^p-1}{a-1}$
Let the sequence $S_i = 2 \cdot T_{a}(S_{i-1}/2)$ where $T_{n}(x)$ is the Chebyshev's polynomial of the first kind with $S_0 = 4$.
Then $N$ is prime if $S_{p} \equiv 2 \cdot T_{a}(2)$ (mod $N$) or $S_{p} \equiv 2 \cdot T_{a-2}(2)$ (mod $N$)
You can run the test here (outdated, see below for new test).
For the moment, I didn't find a counterexample with the two conditions.
I need help for proving it but I don't know how to start. If you found a counterexample please tell me.
EDIT : I made a new test, you can found it here (outdated)
I just changed $S_0$ is now equals to $L_n$ where $L_n$ is the $n$th Lucas number and I changed the final value of the sequence, and it seems it removes some false positive.
EDIT 2 : I made a new test,for $\frac{a^p-1}{a-1}$ you can found it here
This time, $S_0 = p$ and $N$ is prime if $S_{p} \equiv 2 \cdot T_{a}(p/2)$ (mod $N$) or $S_{p} \equiv 2 \cdot T_{a-2}(p/2)$ (mod $N$) and it removes again some false positives.
If you found again a counterexample, please tell me.