Is there any fast method to 'say' that $R = (A \mod B)$ is $1$ or $R > 1$ or $R \neq1$ or $R > k>1$ ( where $k$ is a small integer on $32$ bits) without to actually calculate the real value of $R=(A \mod B)$ ? In my case $A$ and $B$ are large positive integer numbers, e.g $512$ bits length.
Also, the same thing for $R=A^{P}\mod B$ (modular exponentiation) where all $A,P,B \geq512$ bits. i.e they are large numbers. Also, a particular interest for me would be in case when $A = 2$, e.g $R=2^{P-1}\mod P$. I am not interested in the real value of $R$ just to know if this fits one of the stated conditions
- $R > 1$
- $R \neq1$
- $R> k$ , k arbitrarily chosen, small positive integer on 32 bits
A probabilistic method would also be a welcomed solution. Thank you.