]> gitweb.factorcode.org Git - factor.git/blob - basis/math/primes/lucas-lehmer/lucas-lehmer-docs.factor
Switch to https urls
[factor.git] / basis / math / primes / lucas-lehmer / lucas-lehmer-docs.factor
1 ! Copyright (C) 2009 Doug Coleman.
2 ! See https://factorcode.org/license.txt for BSD license.
3 USING: help.markup help.syntax kernel ;
4 IN: math.primes.lucas-lehmer
5
6 HELP: lucas-lehmer
7 { $values
8     { "p" "a prime number" }
9     { "?" boolean }
10 }
11 { $description "Runs the Lucas-Lehmer test on the prime " { $snippet "p" } " and returns " { $link t } " if " { $snippet "(2 ^ p) - 1" } " is prime." }
12 { $examples
13     { $example "! Test that (2 ^ 61) - 1 is prime:"
14                "USING: math.primes.lucas-lehmer prettyprint ;"
15                "61 lucas-lehmer ."
16                "t"
17     }
18 } ;
19
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 } ;
24
25 ABOUT: "math.primes.lucas-lehmer"