Prime Numbers

Prime Numbers Prime Numbers

thales.doa.fmph.uniba.sk
from thales.doa.fmph.uniba.sk More from this publisher
10.12.2012 Views

9.7 Exercises 527 0 2 +3 2 +0 2 is given a weight factor of 1/4. By considering an appropriate m-fold convolution of a certain signal with itself, show that R2(n) = 1 −1 p + (pδ0n − 1) , 4 p R3(n) = 1 p 8 2 −n + p , p R4(n) = 1 3 2 p + p δ0n − p 16 . (A typical test case that can be verified by hand is for p = 23: R4(0) = 12673/16, and for any n ≡ 0(modp), R4(n) = 759.) Now, from these exact relations, conclude: (1) Any prime p ≡ 1 (mod 4) is a sum of two squares, while p ≡ 3(mod4) cannot be (cf. Exercise 5.16). (2) There exists 0

528 Chapter 9 FAST ALGORITHMS FOR LARGE-INTEGER ARITHMETIC 9.44. Implement Algorithm 9.5.19, with a view to proving that p =2 521 − 1 is prime via the Lucas–Lehmer test. The idea is to maintain the peculiar, variable-base representation for everything, all through the primality test. (In other words, the output of Algorithm 9.5.19 is ready-made as input for a subsequent call to the algorithm.) For larger primes, such as the gargantuan new Mersenne prime discoveries, investigators have used run lengths such that q/D, the typical bit size of a variable-base digit, is roughly 16 bits or less. Again, this is to suppress as much as possible the floating-point errors. 9.45. Implement Algorithm 9.5.17 to establish the character of various Fermat numbers, using the Pepin test, that Fn is prime if and only if 3 (Fn−1)/2 ≡−1(modFn). Alternatively, the same algorithm can be used in factorization studies [Brent et al. 2000]. (Note: The balanced representation error reduction scheme mentioned in Exercise 9.55 also applies to this algorithm for arithmetic with Fermat numbers.) This method has been employed for the resolution of F22 in 1993 [Crandall et al. 1995] and F24 [Crandall et al. 1999]. 9.46. Implement Algorithm 9.5.20 to perform large-integer multiplication via cyclic convolution of zero-padded signals. Can the DWT methods be applied to do negacyclic integer convolution via an appropriate CRT prime set? 9.47. Show that if the arithmetic field is equipped with a cube root of unity, then for D = 3 · 2 k one can perform a length-D cyclic convolution by recombining three separate length-2 k convolutions. (See Exercise 9.43 and consider the symbolic factorization of t D − 1forsuchD.) This technique has actually been used by G. Woltman in the discovery of new Mersenne primes (he has employed IBDWTs of length 3 · 2 k ). 9.48. Implement the ideas in [Percival 2003], where Algorithm 9.5.19 is generalized for arithmetic modulo Proth numbers k ·2n ±1. The essential idea is that working modulo a number a ± b can be done with good error control, as long as the prime product p|ab p is sufficiently small. In the Percival approach, one generalizes the variable-base representation of Theorem 9.5.18 to involve products over prime powers in the form x = D−1 j=0 xj p k a ⌈kj/D⌉ p q m b q ⌈−mj/D⌉+mj/D , for fast arithmetic modulo a − b. Note that the marriage of such ideas with the fast mod operation of Algorithm 9.2.14 would result in an efficient union for computations that need to move away from the restricted theme of Mersenne/Fermat numbers. Indeed, as evidenced in the generalized Fermat number searches described in [Dubner and Gallot 2002], wedding bells have already sounded.

9.7 Exercises 527<br />

0 2 +3 2 +0 2 is given a weight factor of 1/4. By considering an appropriate<br />

m-fold convolution of a certain signal with itself, show that<br />

R2(n) = 1<br />

<br />

−1<br />

p + (pδ0n − 1) ,<br />

4 p<br />

R3(n) = 1<br />

<br />

p<br />

8<br />

2 <br />

−n<br />

+ p ,<br />

p<br />

R4(n) = 1 3 2<br />

p + p δ0n − p<br />

16<br />

.<br />

(A typical test case that can be verified by hand is for p = 23: R4(0) =<br />

12673/16, and for any n ≡ 0(modp), R4(n) = 759.)<br />

Now, from these exact relations, conclude:<br />

(1) Any prime p ≡ 1 (mod 4) is a sum of two squares, while p ≡ 3(mod4)<br />

cannot be (cf. Exercise 5.16).<br />

(2) There exists 0

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!