The characteristic equations of the matrices are:
x^2  (1+u)*x + u1 == 0 and
x^2  (1+w)*x + w1 == 0
The "residuals" depend on the jacobi symbol of the discriminants of these equations:
Jacobi((1+u)^24(u1), n)
jacobi((1+w)^24(w1), n)
If the Jacobi symbol is 1 then the matrical test is a glorified Fermat PRP test. If the symbol is 1 then it is a lucasbased test.
Recieved wisdom says that any Fermat+Lucas test has counterexamples for freely varying parameters (unless maybe the choice of u and w are more restricted  which is what I am currently studying).
Last fiddled with by paulunderwood on 20200911 at 16:57
