Recently I came across a YouTube video which explains the easiest way to check whether the given number is prime or not the equation was:
$$\frac{2^x - 2}{x}$$
According to that video if $x$ is a prime number, it will give a whole number as a result. If $x$ is not a prime number, it will give a number with decimal place as result.
For example for 6, the result is 10.333... so it is not a prime. for 7, the result is 18 so it is a prime number.
I tried out some number and found out that this is true for most of the number, How's this possible? is this a correct equation.
See the full video here: https://youtu.be/AUn7h05A8WM
The correct statement is: for all positive odd integers $n$, if $n$ is prime, then $n$ divides $2^n-1$.
Here is a quick proof: For any prime $p$ and $k< p$, we know that $p$ can't divide $k!$, but $p$ does divide $p!$. Therefore $$p\mid{p\choose k}$$ for all $p>k>0$. For all positive integers $a$, we have by the binomial formula: $$2^p=(1+1)^p=\sum_{k=0}^{p}{p\choose k}$$ $p$ divides all terms of this sum, except where $k=0$ and $k=p$, so there is some integer $n$ such that:
$$2^p=pn+{p\choose 0}1^0+{p\choose p}1^p=pn+2$$ so $2^p-2=pn$, so $2^p-2$ is divisible by $p$.