1 ! Copyright (C) 2009 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: help.markup help.syntax kernel ;
4 IN: math.primes.lucas-lehmer
8 { "p" "a prime number" }
11 { $description "Runs the Lucas-Lehmer test on the prime " { $snippet "p" } " and returns " { $link t } " if " { $snippet "(2 ^ p) - 1" } " is prime." }
13 { $example "! Test that (2 ^ 61) - 1 is prime:"
14 "USING: math.primes.lucas-lehmer prettyprint ;"
20 ARTICLE: "math.primes.lucas-lehmer" "Lucas-Lehmer Mersenne Primality test"
21 "The " { $vocab-link "math.primes.lucas-lehmer" } " vocabulary tests numbers of the form " { $snippet "(2 ^ p) - 1" } " for primality, where " { $snippet "p" } " is prime." $nl
22 "Run the Lucas-Lehmer test:"
23 { $subsections lucas-lehmer } ;
25 ABOUT: "math.primes.lucas-lehmer"