Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on The Lehmann primality test..
This assertion is false if I understood the test correctly.
Take n = 5, a = 2.
a ^ ((n - 1) / 2) = 2 ^ ((5 - 1) / 2) = 2 ^ 2 = 4 and 4 mod 5 = 4.
Therefore the test will say 5 is composite.
This assertion is false if I understood the test correctly.
Take n = 5, a = 2.
a ^ ((n - 1) / 2) = 2 ^ ((5 - 1) / 2) = 2 ^ 2 = 4 and 4 mod 5 = 4.
Therefore the test will say 5 is composite.