这里是...
\n\nInput: n > 3, an odd integer to be tested for primality;\nInput: k, a parameter that determines the accuracy of the test\nOutput: composite if n is composite, otherwise probably prime\nWrite n \xe2\x88\x92 1 as (2^s)\xc2\xb7d with d odd by factoring powers of 2 from n \xe2\x88\x92 1\nWitnessLoop: repeat k times:\n pick a random integer a in the range [2, n \xe2\x88\x92 2]\n x \xe2\x86\x90 a^d mod n\n if x = 1 or x = n \xe2\x88\x92 1 then …Run Code Online (Sandbox Code Playgroud)