I am trying to determine the primality of really big numbers n with ~25000 digits knowing that (n-1) = AB(B-x), where A, B and x are known but x is not constant meaning that i want to test primality of a ton of numbers of the same form.
The problem is A and B are also big numbers (~8000 digits) and since the only theorem that i found that could help me was
Theorem 2: Suppose n-1 = FR, where F>R, gcd(F,R) is one and the factorization of F is known. If for every prime factor q of F there is an integer a>1 such that
a^(n-1) = 1 (mod n), and
gcd(a^[(n-1)/q]-1,n) = 1;
then n is prime.
which to me looks like will take ages to run in any machine since i have to test for all a given 1 < a < n.
The question is there some FAST way to determine primality of n knowing (n-1) factors or at least a way to guess primality with a small chance of error?
Right now i have a list with 150000 values of x, so i would like to test ~15000 numbers of the form AB(B-x) + 1 for primality.
Link Theorem page: https://primes.utm.edu/prove/prove3_1.html#Pocklington