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>