The Chinese Remainder Theorem. Consider

Một phần của tài liệu The art and craft of problem solving (Trang 251 - 256)

the following simultaneous congruence.

x = 3 (mod I I),

x = 5 (mod 6) .

It is easy to find a solution, x = 47, by inspection.

Here 's another method. Since 6 1- I I, we can find a linear combination of 6 and I I that equals one, for ex­

ample, ( -I) . I I + 2 ã 6 = I. Now compute 5 ã ( - 1 ) ã 1 1 + 3 ã 2 ã 6 = - 1 9 .

This number is a solution, modulo 6 6 = 6 ã I I. Indeed,

47 = - 1 9 (mod 66) . (a) Why does this work?

(b) Note that the two moduli (which were I I and 6

in the example) must be relatively prime. Show

by example that there may not always be a so­

lution to a simultaneous congruence if the two moduli share a factor.

(c) Let m 1- n, let a and b be arbitrary, and let x simultaneously satisfy the congruences x = a

(mod m) and x = b (mod n). The algorithm described above will produce a solution for x.

Show that this solution is unique modulo mn.

(d) Show that this algorithm can be extended to any finite number of simultaneous congruences, as long as the moduli are pairwise relatively prime.

(e) Show that there exist three consecutive num­

bers, each of which is divisible by the 1 999th power of an integer.

(f) Show that there exist 1 999 consecutive num­

bers, each of which is divisible by the cube of an integer.

7.2.19 (USAMO 1 995) Let p be an odd prime. The sequence (an)n::o:O is defined as follows: ao = 0, a, =

1 , ... , ap_2 = p - 2 and, for all n"2p-l, an is the

least integer greater than an-, that does not form an arithmetic sequence of length p with any of the pre­

ceding terms. Prove that, for all n, an is the number obtained by writing n in base p -I and reading the result in base p.

7.2.20 (Putnam 1 995) The number dld2 .. . d9 has

nine (not necessarily distinct) decimal digits. The number e I e2 .. . e9 is such that each of the nine 9-digit numbers formed by replacing just one of the digits di

is d,d2 " .d9 by the corresponding digit ei ( 1 :S i :S 9)

is divisible by 7. The number !lh . . . 19 is related to el e2 .. . e9 in the same way : that is, each of the nine numbers formed by replacing one of the ei by

the corresponding Ii is divisible by 7. Show that, for each i, di -Ii is divisible by 7. (For example, if

d,d2 " .d9 = 1 9950 1 996, then e6 may be 2 or 9, since 1 99502996 and 1 99509996 are multiples of 7.)

7.2.21 (Putnam 1 994) Suppose a, b, c , d are integers with 0 :S a :S b :S 99, 0 :S c :S d :S 99. For any integer

i, let ni = IOli + 1 00i . Show that if na +nh is congru­

ent to nc + nd mod 10 1 00, then a = c and b = d.

7.3 Number Theoretic Functions

Of the infinitely many functions with domain N, we will single out a few that are especially interesting. Most of these functions are mUltiplicative. A function 1 with this property satisfies

I(ab) = l(a)/(b)

whenever a ..1 b.

7.3.1 Show that if I : N ---4 N is multiplicative, then 1( 1 ) = 1 .

7.3.2 If a function 1 is multiplicative, then in order to know all values of I, it is sufficient to know the values of I(pr) for each prime p and each r E N.

Divisor Sums

Define

where r can be any integer. For example,

0'2 ( 10) = 1 2 + 22 + 52 + 102 = 1 30.

In other words, O'r (n) is the sum of the rth power of the divisors of n. Although it is useful to define this function for any value of r, in practice we rarely consider values other than r = 0 and r = 1 .

7.3.3 Notice that O'o (n) is equal to the number of divisors of n . This function is usually denoted by d(n) . You encountered it in Example 3. 1 on page 68 and Problem 6. 1 .2 1

on page 1 95. Recall that if

n = p�l p�2 . . . p�'

is the prime factorization of n, then

d(n) = (e \ + 1 ) (e2 + 1 ) . . . (et + 1 ) .

From this formula we can conclude that d(n) is a multiplicative function.

7.3.4 Show by examples that d(ab) does not always equal d(a)d(b) if a and b are not

relatively prime. In fact, prove that d(ab) < d(a)d(b) when a and b are not relatively prime.

7.3.5 The function 0'\ (n) is equal to the sum of the divisors of n and is usually denoted simply by O'(n) .

pr+ \ _ 1

(a) Show that O'(pr) = for prime p and positive r.

p - 1

(b) Show that 0' (pq) = (p + 1 ) (q + 1) for distinct primes p, q.

236 CHAPTER 7 N U M B E R THEORY

7.3.6 An Important Counting Principle. Let n = ab, where a ..1 b. Show that if

din then d = uv, where ula and vlb. Moreover, this is a 1 -to- 1 correspondence: each different pair of u, v satisfying ula, vlb produces a different d : = uv that divides n.

7.3.7 Use (7.3.6) to conclude that O"(n) is a multiplicative function. For example,

1 2 = 3 ã 4, with 3 ..1 4, and we have

0"( 1 2) = 1 + 2 + 4 + 3 + 6 + 1 2

= ( 1 + 2 + 4) + ( 1 ã 3 + 2 ã 3 + 4 ã 3)

= ( 1 + 2 + 4) ( 1 + 3)

= 0"(4) 0"(3) .

7.3.8 Notice in fact, that (7.3.6) can be used to show that O"r (n) is multiplicative, no matter what r is.

7.3.9 In fact, we can do more. The counting principle that we used can be reformu­

lated in the following way: Let n = ab with a ..1 b, and let f be any multiplicative function. Carefully verify (try several concrete examples) that

)J(d) = ) ()J(UV))

din * �

� � (�f(U)f(V))

� (�f(U)) (�f(V)).

We have proven the following general fact.

Let

F(n ) := din )f(d).

If f is multiplicative then F will be multiplicative as well.

Phi and Mu

Define cp (n) to be the number of positive integers less than or equal to n that are relatively prime to n. For example, cp ( 1 2) = 4, since 1 , 5 , 7, I I are relatively prime to

1 2.

We can use PIE (the principle of inclusion-exclusion; see Section 6.3) to evaluate

cp (n) . For example, to compute cp ( 1 2) , the only relevant properties to consider are divisibility by 2 or divisibility by 3 because 2 and 3 are the only primes that divide 1 2.

As we have done many times, we shall count the complement; i.e., we will count how many integers between 1 and 1 2 (inclusive) share a factor with 1 2. If we let Mk denote the mUltiples of k up to 1 2, then we need to compute

IM2 U M3 1 ,

since any number that shares a factor with 12 will be a mUltiple of either 2 or 3 (or

both). Now PIE implies that

1M2 U M3 1 = IM2 1 + IM3 1 - IM2 n M3 1 ã

Because 2 1-3, we can rewrite M2 n M3 as M6. Thus we have

cp ( 1 2) = 1 2 - 1M2 U M3 1 = 1 2 - ( IM2 1 + 1M3 ! ) + IM6 1 = 1 2 - (6 + 4) + 2 = 4.

7.3.10 Let p and q be distinct primes. Show that (a) cp (p) = p - l ,

(b) cp (pr) = pr _ pr- l = pr- l (p _ l ) = pr ( 1 - �).

(c) cp (pq) = (p - 1 ) ( q - 1 ) = pq ( 1 - �) ( 1 - � ).

(d) cp (prl) = pr- l (p _ l )qS- l (q _ l ) = prqs ( I _ �) ( 1 - �) .

These special cases above certainly suggest that cp is multiplicative. This is easy to verify with PIE. For example, suppose that n contains only the distinct primes p, q, w.

If we let Mk denote the number of positive multiples of k less than or equal to n, we have

cp (n) = n - ( IMp l + IMq l + IMw l ) + ( IMpq l + IMpw l + IMqw l ) - IMpqw l ã

In general,

but since p, q, w all divide n, we can drop the brackets;

cp (n) = n - (� + � + �p q w ) + (� + � + �pq pw qw ) - � , pqw

and this factors beautifully as

If we write n = pr qSw , we have

cp (n) = pr ( 1 - �) qS ( 1 - �) w ( 1 _ ± ) = cp (pr) cp (qs) cp (w1 ) ,

(2)

using the formulas in 7.3. 10. This argument certainly generalizes to any number of distinct primes, so we have established that cp is multiplicative. And in the process, we developed an intuitively reasonable formula. For example, consider 360 = 23.32.5 . Our formula says that

cp(360) = 360 ( 1 - �) ( 1 - �) ( 1 - �) ,

238 CHAPTER 7 N U M B E R THEORY

and this makes sense; for we could argue that half of the positive integers up to 360

are odd, and two-thirds of these are not multiples of three, and four-fifths of what are

left are not multiples of five. The final fraction (! . � . �) of 360 will be the numbers that share no divisors with 360. This argument is not quite rigorous. It tacitly assumes that divisibility by different primes is in some sense "independent" in a probabilistic sense. This is true, and it can be made rigorous, but this is not the place for it. 5

Let us pretend to change the subject for a moment by introducing the Mobius function J1 (n). We define

J1(n) = { � ( - I t

if n = 1 ;

if p21n for some prime p;

if n = P I P2 ã ã ã Pr , each P a distinct prime.

This is a rather bizarre definition, but it turns out that the Mobius function very conve­

niently "encodes" PIE. Here is a table of the first few values of J1 (n) .

7.3.1 1 Verify that J1 is multiplicative.

7.3. 12 Use 7.3. 1 1 and 7.3.9 to show that

tJ1(d) = { 6 if if n n = > 1 ; 1 .

The values of J1 (n) alternate sign depending on the parity of the number of prime factors of n. This is what makes the Mobius function related to PIE. For example, we could rewrite equation (2) as

(3)

This works because of J1 's "filtering" properties. If a divisor d in the sum above con­

tains powers of primes larger than 1 , J1 (d) = 0, so the term is not present. If d is equal to a single prime, say P , the term will be _ !!.. . Likewise, if d = pq, the term becomes

p

+ � , etc. And of course (3) is a general formula, true for any n.

pq

Problems and Exercises

7.3.13 Make a table, either by hand or with the aid of a computer, of the values of den), iP(n), cr(n),J.l(n) for,

say, 1 :S n :S 100 or so.

7.3. 14 Prove that iP(n) = 14 has no solutions.

7.3.15 In 7.3.4, you showed that d(ab) < d(a)d(b)

whenever a and b are relatively prime. What can you say about the cr function in this case?

7.3. 1 6 Find the smallest integer n for which iP(n) = 6.

7.3. 17 Find the smallest integer n for which den) = 10.

5 See [24] for a wonderful discussion of this and related issues.

7.3.18 Find n E N such that J.l(n) + J.l(n + I) + J.l(n +

2) = 3.

7.3.19 Show that for all n,r E N, Gr(n) r

-- G-r(n) - . - n

7.3.20 For n > I, define

ro(n) = � I,

Pm

where the p in the sum must be prime. For n = I, let ro(n) = 1. In other words, ro(n) is the number of dis­

tinct prime divisors of n. For example, ro( 12) = 2 and ro(7344) = 1.

(a) Compute ro(n) for n = 1, ... ,25.

(b) What is ro( 17!)?

(c) I s ro multiplicative? Explain.

7.3.21 Likewise, for n > I, define .Q(n) = �. e,

ptrrn

where again, p must be prime. For n = I, we define

.Q(n) = 1. Thus .Q(n) is the sum of all the exponents that appear in the prime-power factorization of n. For

example, .Q ( 1 2) = 2 + I = 3, because 12 = 2231•

(a) Compute.Q(n)forn = 1, ... ,25.

(b) Show, with a counterexample, that .Q is not

multiplicative.

(c) However, there is a simple formula for .Q(ab),

when (a,b) = 1. What i s it? Explain.

7.3.22 Define

F(n) = �g(d),

where g(l) = I and g(k) = (_1).o(k) if k > 1. Find a

simple rule for the F.

7.3.23 There are two very different ways to prove 7.3 . 1 2. One method, which you probably used already, was to observe that F(n) := }:dln J.l(d) is a multiplica­

tive function, and then calculate that F(pr) = 0 for all

primes. But here is another method: ponder the equa­

tion

1: ( ro � n) ) (_I)k = (1 _ I)oo(n) = 0,

where ro(n) was defined in 7.3.20. Explain why this equation is true, and also why it proves 7.3.12.

7.3.24 Prove that tfJ(n) + G(n) = 2n if and only if n is

prime.

Một phần của tài liệu The art and craft of problem solving (Trang 251 - 256)

Tải bản đầy đủ (PDF)

(383 trang)