Miller–Rabin primality test: Difference between revisions

(→‎Python: Proved correct up to large N: Better generation of initial _known_primes)
Line 1,959:
 
;Testing:
Using theIncludes test values from the Ada and Haskellother examples:
<pre>>>> is_prime(4547337172376300111955330758342147474062293202868155909489)
True
Line 1,966:
>>> [x for x in range(901, 1000) if is_prime(x)]
[907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997]
>>> is_prime(643808006803554439230129854961492699151386107534013432918073439524138264842370630061369715394739134090922937332590384720397133335969549256322620979036686633213903952966175107096769180017646161851573147596390153)
True
>>> is_prime(743808006803554439230129854961492699151386107534013432918073439524138264842370630061369715394739134090922937332590384720397133335969549256322620979036686633213903952966175107096769180017646161851573147596390153)
False
>>> </pre>
 
Anonymous user