词条 | Lucas pseudoprime |
释义 |
Lucas pseudoprimes and Fibonacci pseudoprimes are composite integers that pass certain tests which all primes and very few composite numbers pass: in this case, criteria relative to some Lucas sequence. Bruckman-Lucas pseudoprimesThe Lucas pseudoprimes as defined by Bruckman are as follows.[1] The Lucas numbers may be defined as: (where n belongs to the natural numbers). For any prime p, Lp is congruent to 1 mod p. The converse is almost always true, that is, if n is composite, Ln is not congruent to 1 mod n in most cases. The exceptions are the Bruckman-Lucas pseudoprimes, of which the first few are n = 705, 2465, 2737, 3745, 4181, 5777, 6721, ...[2] Baillie-Wagstaff-Lucas pseudoprimesBaillie and Wagstaff define Lucas pseudoprimes differently.[3] Given integers P and Q, where P > 0 and , let Uk(P, Q) and Vk(P, Q) be the corresponding Lucas sequences. Let n be a positive integer and let be the Jacobi symbol. We define If n is a prime such that the greatest common divisor of n and Q (that is, GCD(n, Q)) is 1, then the following congruence condition holds: {{NumBlk|:||{{EquationRef|1}}}}If this equation does not hold, then n is not prime. If n is composite, then this equation usually does not hold.[3] These are the key facts that make Lucas sequences useful in primality testing. Some good references are chapter 8 of the book by Bressoud and Wagon (with Mathematica code),[4] pages 142–152 of the book by Crandall and Pomerance,[5] and pages 53–74 of the book by Ribenboim.[6] Lucas probable primes and pseudoprimesA Lucas probable prime for a given (P, Q) pair is any positive integer n for which equation ({{EquationNote|1}}) above is true (see,[3] page 1398). A Lucas pseudoprime for a given (P, Q) pair is a positive composite integer n for which equation ({{EquationNote|1}}) is true (see,[3] page 1391). A Lucas probable prime test is most useful if D is chosen such that the Jacobi symbol is −1 (see pages 1401–1409 of,[3] page 1024 of ,[7] or pages 266–269 of [4] ). This is especially important when combining a Lucas test with a strong pseudoprime test, such as the Baillie-PSW primality test. Typically implementations will use a parameter selection method that ensures this condition (e.g. the Selfridge method recommended in [3] and described below). If then equation ({{EquationNote|1}}) becomes {{NumBlk|:||{{EquationRef|2}}}}If congruence ({{EquationNote|2}}) is false, this constitutes a proof that n is composite. If congruence ({{EquationNote|2}}) is true, then n is a Lucas probable prime. In this case, either n is prime or it is a Lucas pseudoprime. If congruence ({{EquationNote|2}}) is true, then n is likely to be prime (this justifies the term probable prime), but this does not prove that n is prime. As is the case with any other probabilistic primality test, if we perform additional Lucas tests with different D, P and Q, then unless one of the tests proves that n is composite, we gain more confidence that n is prime. Examples: If P = 3, Q = −1, and D = 13, the sequence of U's is {{oeis|id=A006190}}: U0 = 0, U1 = 1, U2 = 3, U3 = 10, etc. First, let n = 19. The Jacobi symbol is −1, so δ(n) = 20, U20 = 6616217487 = 19·348221973 and we have Therefore, 19 is a Lucas probable prime for this (P, Q) pair. In this case 19 is prime, so it is not a Lucas pseudoprime. For the next example, let n = 119. We have = −1, and we can compute However, 119 = 7·17 is not prime, so 119 is a Lucas pseudoprime for this (P, Q) pair. In fact, 119 is the smallest pseudoprime for P = 3, Q = −1. We will see below that, in order to check equation ({{EquationNote|2}}) for a given n, we do not need to compute all of the first n + 1 terms in the U sequence. Let Q = −1, the smallest Lucas pseudoprime to P = 1, 2, 3, ... are 323, 35, 119, 9, 9, 143, 25, 33, 9, 15, 123, 35, 9, 9, 15, 129, 51, 9, 33, 15, 21, 9, 9, 49, 15, 39, 9, 35, 49, 15, 9, 9, 33, 51, 15, 9, 35, 85, 39, 9, 9, 21, 25, 51, 9, 143, 33, 119, 9, 9, 51, 33, 95, 9, 15, 301, 25, 9, 9, 15, 49, 155, 9, 399, 15, 33, 9, 9, 49, 15, 119, 9, ... Strong Lucas pseudoprimesNow, factor into the form where is odd. A strong Lucas pseudoprime for a given (P, Q) pair is an odd composite number n with GCD(n, D) = 1, satisfying one of the conditions or for some 0 ≤ r < s; see page 1396 of.[3] A strong Lucas pseudoprime is also a Lucas pseudoprime (for the same (P, Q) pair), but the converse is not necessarily true. Therefore, the strong test is a more stringent primality test than equation ({{EquationNote|1}}). We can set Q = −1, then and are P-Fibonacci sequence and P-Lucas sequence, the pseudoprimes can be called strong Lucas pseudoprime in base P, for example, the least strong Lucas pseudoprime with P = 1, 2, 3, ... are 323, 169, 119, ... An extra strong Lucas pseudoprime [8]is a strong Lucas pseudoprime for a set of parameters (P, Q) where Q = 1, satisfying one of the conditions or for some . An extra strong Lucas pseudoprime is also a strong Lucas pseudoprime for the same pair. Implementing a Lucas probable prime testBefore embarking on a probable prime test, one usually verifies that n, the number to be tested for primality, is odd, is not a perfect square, and is not divisible by any small prime less than some convenient limit. Perfect squares are easy to detect using Newton's method for square roots. We choose a Lucas sequence where the Jacobi symbol , so that δ(n) = n + 1. Given n, one technique for choosing D is to use trial and error to find the first D in the sequence 5, −7, 9, −11, ... such that . Note that . (If D and n have a prime factor in common, then ). With this sequence of D values, the average number of D values that must be tried before we encounter one whose Jacobi symbol is −1 is about 1.79; see,[3] p. 1416. Once we have D, we set and . It is a good idea to check that n has no prime factors in common with P or Q. This method of choosing D, P, and Q was suggested by John Selfridge. (This search will never succeed if n is square, and conversely if it does succeed, that is proof that n is not square. Thus, some time can be saved by delaying testing n for squareness until after the first few search steps have all failed.) Given D, P, and Q, there are recurrence relations that enable us to quickly compute and in steps; see {{slink|Lucas sequence|Other relations}}. To start off, First, we can double the subscript from to in one step using the recurrence relations . Next, we can increase the subscript by 1 using the recurrences . If is odd, replace it with ; this is even so it can now be divided by 2. The numerator of is handled in the same way. (Adding n does not change the result modulo n.) Observe that, for each term that we compute in the U sequence, we compute the corresponding term in the V sequence. As we proceed, we also compute the same, corresponding powers of Q. At each stage, we reduce , , and the power of , mod n. We use the bits of the binary expansion of n, starting at the leftmost bit, to determine which terms in the U sequence need to be computed. For example, if n+1 = 44 (= 101100 in binary), then, using these bits from left to right, we compute U1 = 1, U2 = 10, U4 = 100, U5 = 101, U10 = 1010, U11 = 1011, U22 = 10110, and U44 = 101100. We also compute the same-numbered terms in the V sequence, along with Q1, Q2, Q4, Q5, Q10, Q11, Q22, and Q44. By the end of the calculation, we will have computed Un+1, Vn+1, and Qn+1, (mod n). We then check congruence ({{EquationNote|2}}) using our known value of Un+1. When D, P, and Q are chosen as described above, the first 10 Lucas pseudoprimes are (see page 1401 of [3]): 323, 377, 1159, 1829, 3827, 5459, 5777, 9071, 9179, and 10877 {{OEIS|id=A217120}} The strong versions of the Lucas test can be implemented in a similar way. When D, P, and Q are chosen as described above, the first 10 strong Lucas pseudoprimes are: 5459, 5777, 10877, 16109, 18971, 22499, 24569, 25199, 40309, and 58519 {{OEIS|id=A217255}}To calculate a list of extra strong Lucas pseudoprimes, set . Then try P = 3, 4, 5, 6, ..., until a value of is found so that the Jacobi symbol . With this method for selecting D, P, and Q, the first 10 extra strong Lucas pseudoprimes are 989, 3239, 5777, 10877, 27971, 29681, 30739, 31631, 39059, and 72389 {{OEIS|id=A217719}}Checking additional congruence conditionsIf we have checked that congruence ({{EquationNote|2}}) is true, there are additional congruence conditions we can check that have almost no additional computational cost. If n happens to be composite, these additional conditions may help discover that fact. If n is an odd prime and , then we have the following (see equation 2 on page 1392 of [3]): {{NumBlk|:||{{EquationRef|3}}}}Although this congruence condition is not, by definition, part of the Lucas probable prime test, it is almost free to check this condition because, as noted above, the value of Vn+1 was computed in the process of computing Un+1. If either congruence ({{EquationNote|2}}) or ({{EquationNote|3}}) is false, this constitutes a proof that n is not prime. If both of these congruences are true, then it is even more likely that n is prime than if we had checked only congruence ({{EquationNote|2}}). If Selfridge's method (above) for choosing D, P, and Q happened to set Q = −1, then we can adjust P and Q so that D and remain unchanged and P = Q = 5 (see Lucas sequence-Algebraic relations). If we use this enhanced method for choosing P and Q, then 913 = 11·83 is the only composite less than 108 for which congruence ({{EquationNote|3}}) is true (see page 1409 and Table 6 of;[3]). Here is another congruence condition that is true for primes and that is trivial to check. Recall that is computed during the calculation of . It would be easy to save the previously-computed power of , namely, . Next, if n is prime, then, by Euler's criterion, . (Here, is the Legendre symbol; if n is prime, this is the same as the Jacobi symbol). Therefore, if n is prime, we must have . The Jacobi symbol on the right side is easy to compute, so this congruence is easy to check. If this congruence does not hold, then n cannot be prime. Additional congruence conditions that must be satisfied if n is prime are described in Section 6 of.[3] If any of these conditions fails to hold, then we have proved that n is not prime. Comparison with the Miller–Rabin primality testk applications of the Miller–Rabin primality test declare a composite n to be probably prime with a probability at most (1/4)k. There is a similar probability estimate for the strong Lucas probable prime test.[9] Aside from two trivial exceptions (see below), the fraction of (P,Q) pairs (modulo n) that declare a composite n to be probably prime is at most (4/15). Therefore, k applications of the strong Lucas test would declare a composite n to be probably prime with a probability at most (4/15)k. There are two trivial exceptions. One is n = 9. The other is when n = p(p+2) is the product of two twin primes. Such an n is easy to factor, because in this case, n+1 = (p+1)2 is a perfect square. One can quickly detect perfect squares using Newton's method for square roots. By combining a Lucas pseudoprime test with a Fermat primality test, say, to base 2, one can obtain very powerful probabilistic tests for primality, such as the Baillie–PSW primality test. Fibonacci pseudoprimesAs noted above, when P = 1 and Q = −1, the numbers in the U sequence are the Fibonacci numbers. A Fibonacci pseudoprime is often (page 264 of,[4] page 142 of,[5] or page 127 of [6]) defined as a composite number n for which equation ({{EquationNote|1}}) above is true with P = 1 and Q = −1 (but n is not divisible by 5). By this definition, the first ten Fibonacci pseudoprimes are 323, 377, 1891, 3827, 4181, 5777, 6601, 6721, 8149, and 10877 {{OEIS|id=A081264}}. The references of Anderson and Jacobsen below use this definition. If n is congruent to 2 or 3 (mod 5), then Bressoud (,[4] pages 272–273) and Crandall and Pomerance (,[5] page 143 and exercise 3.41 on page 168) point out that it is rare for a Fibonacci pseudoprime to also be a Fermat pseudoprime base 2. However, when n is congruent to 1 or 4 (mod 5), the opposite is true, with over 12% of Fibonacci pseudoprimes under 1011 also being base-2 Fermat pseudoprimes. If n is prime and GCD(n, Q) = 1, then (see equation 4 on page 1392 of [3]) we also have This leads to an alternate definition of Fibonacci pseudoprime.[10] By this definition, a Fibonacci pseudoprime is a composite number n for which equation (5) is true with P = 1 and Q = −1. Using this definition, the first ten Fibonacci pseudoprimes are 705, 2465, 2737, 3745, 4181, 5777, 6721, 10877, 13201, and 15251 ([6] page 129) {{OEIS|id=A005845}}. It has been shown that there are no even Fibonacci pseudoprimes with the second definition using equation (5).[11] Using the more common first definition with equation ({{EquationNote|1}}), they do exist {{OEIS|id=A141137}}. A strong Fibonacci pseudoprime may be defined as a composite number for which equation (5) holds for all P.[12] It follows ([12] page 460) that an odd composite integer is a strong Fibonacci pseudoprime if and only if:
The smallest example of a strong Fibonacci pseudoprime is 443372888629441 = 17·31·41·43·89·97·167·331. Pell pseudoprimesA Pell pseudoprime may be defined as a composite number n for which equation ({{EquationNote|1}}) above is true with P = 2 and Q = −1; the sequence Un then being the Pell sequence. The first pseudoprimes are then 35, 169, 385, 779, 899, 961, 1121, 1189, 2419, ... This differs from the definition in {{OEIS2C|id=A099011}} which may be written as: with (P, Q) = (2, −1) again defining Un as the Pell sequence. The first pseudoprimes are then 169, 385, 741, 961, 1121, 2001, 3827, 4879, 5719, 6215 ... A third definition uses equation (5) with (P, Q) = (2, −1), leading to the pseudoprimes 169, 385, 961, 1105, 1121, 3827, 4901, 6265, 6441, 6601, 7107, 7801, 8119, ... References1. ^{{cite journal |author1 = P. S. Bruckman |title=Lucas Pseudoprimes are odd |journal=Fibonacci Quarterly |date=1994 |volume=32 |pages=155–157}} 2. ^{{Cite OEIS |A005845 |Bruckman-Lucas pseudoprimes}} 3. ^1 2 3 4 5 6 7 8 9 10 11 12 {{cite journal |author1 = Robert Baillie |author2 = Samuel S. Wagstaff, Jr. |author-link2 = Samuel S. Wagstaff, Jr. |title=Lucas Pseudoprimes |journal=Mathematics of Computation |date=October 1980 |volume=35 |issue=152 |pages=1391–1417 |url=http://mpqs.free.fr/LucasPseudoprimes.pdf |mr=583518 |jstor=2006406 |doi=10.1090/S0025-5718-1980-0583518-6 }} 4. ^1 2 3 {{cite book | author = David Bressoud |author-link=David Bressoud |author2=Stan Wagon |author-link2=Stan Wagon| title = A Course in Computational Number Theory | publisher = Key College Publishing in cooperation with Springer | location = New York | year = 2000 | isbn = 978-1-930190-10-8 }} 5. ^1 2 {{cite book | title=Prime numbers: A computational perspective | edition=2nd | author=Richard E. Crandall | authorlink=Richard Crandall |author2=Carl Pomerance |author-link2=Carl Pomerance | publisher=Springer-Verlag | year=2005 | isbn=0-387-25282-7}} 6. ^1 2 {{cite book | title=The New Book of Prime Number Records | author=Paulo Ribenboim |author-link=Paulo Ribenboim | publisher=Springer-Verlag | year=1996 | isbn=0-387-94457-5 }} 7. ^{{cite journal |author1 = Carl Pomerance |author-link1 = Carl Pomerance |author2 = John L. Selfridge |author-link2 = John L. Selfridge |author3 = Samuel S. Wagstaff, Jr. |author-link3 = Samuel S. Wagstaff, Jr. |title=The pseudoprimes to 25·109 |journal=Mathematics of Computation |date=July 1980 |volume=35 |issue=151 |pages=1003–1026 |url=//math.dartmouth.edu/~carlp/PDF/paper25.pdf |jstor=2006210 |doi=10.1090/S0025-5718-1980-0572872-7 }} 8. ^{{cite journal|title=Frobenius Pseudoprimes|journal=Mathematics of Computation|date=March 2000|volume=70|issue=234|pages=873–891|author=Jon Grantham| mr=1680879| doi=10.1090/S0025-5718-00-01197-2 }} 9. ^{{cite journal|title=The Rabin-Monier Theorem for Lucas Pseudoprimes|journal=Mathematics of Computation|date=April 1997|volume=66|issue=218|pages=869–881|url=http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.192.4789|author=F. Arnault|doi=10.1090/s0025-5718-97-00836-3}} 10. ^{{cite journal|author=Di Porto, Adina|author2=Filipponi, Piero|author3=Montolivo, Emilio|title=On the generalized Fibonacci pseudoprimes|journal=Fibonacci Quarterly|volume=28|pages=347–354|date=1990|citeseerx=10.1.1.388.4993}} 11. ^{{cite journal|author=Di Porto, Adina|title=Nonexistence of Even Fibonacci Pseudoprimes of the First Kind|journal=Fibonacci Quarterly|volume=31|pages=173–177|date=1993|citeseerx=10.1.1.376.2601}} 12. ^1 {{cite conference|author=Müller, Winfried B.|author2=Oswald,Alan|title=Generalized Fibonacci Pseudoprimes and Probable Primes|editor=G.E. Bergum|book-title=Applications of Fibonacci Numbers|volume=5|pages=459–464|publisher=Kluwer|date=1993|doi=10.1007/978-94-011-2058-6_45|display-editors=etal}} External links
2 : Fibonacci numbers|Pseudoprimes |
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。