Skip to main content

Congruences

note

This is Lab 3 from Clint by Hugh Montgomery, edited by Elad Zelingher. All rights reserved to Hugh Montgomery.

Problem 1

The program CngArTab displays the addition and multiplication tables of congruence arithmetic. After entering an initial modulus nn. invertible residue classes are displayed in white, to aid in distinguishing them from non-invertible residue classes, in yellow. In the multiplication table, which rows constitute a complete residue system (each residue once and only once)? Refer to Theorem 2.6 of NZM.

Problem 2

If two invertible residue classes are multiplied, is their product necessarily a invertible residue class? Experiment, and recall Theorem 1.8 of NZM.

Problem 3

When viewing the multiplication table, the display can be restricted to the invertible residue classes by hitting the checkbox. Try this with n=15n=15, for example. Do the numbers in a given row of the table constitute a system of invertible residues? Refer again to Theorem 2.6 of NZM. Try this also with n=91n=91, and note the location of the gaps in the invertible residues.

Problem 4

Take n=35n=35 in CngArTab. For which a(mod35)a (\bmod 35) does there exist an xx such that ax1(mod35)?a x \equiv 1 (\bmod 35) ? That is, in which rows of the multiplication table do you see a 1? Is there any row containing more than one 1? (Numbers in the first column don't count.) Refer to Theorem 2.9 of NZM.

Problem 5

Use the program PowerTab to investigate the following questions. For which values of a(modn)a(\bmod n) is the sequence a0,a1,a2,(modn)a^{0}, a^{1}, a^{2}, \ldots(\bmod n) eventually periodic? Purely periodic? Try all values of aa for several moduli (say n=4,5,6,7n=4,5,6,7 ), and note the results. Formulate conjectures concerning the general situation. How does the behavior for prime nn differ from composite nn? Is the value of gcd(a,n)\gcd (a, n) relevant? For now you can assume that PowerTab computes the powers of a(modn)a(\bmod n) sequentially. Actually, this program can skip forward to calculate ak(modn)a^{k}(\bmod n) quickly, without determining the intervening powers.

Problem 6

The number of invertible residue classes (mod nn ) is called ϕ(n)\phi(n). (See pp. 50, 51 of NZM.) Determine the value of ϕ(91)\phi(91) by the following method: There are precisely 13 numbers a,0a<91a, 0 \leq a<91 such that 7a7 \mid a. Similarly, there are precisely 7 numbers aa, 0a<910 \leq a<91 for which 13a13 \mid a, and precisely 1 number a,0a<91a, 0 \leq a<91 for which both 7a7 \mid a and 13a13 \mid a. Hence ϕ(91)=91137+1=72\phi(91)=91-13-7+1=72. By using CngArTab to view the multiplication table (mod 91) with only invertible residues displayed, you can confirm that this calculation is correct. More generally, if n=p1p2n=p_{1} p_{2} where p1p_{1} and p2p_{2} are distinct primes, then ϕ(n)=nn/p1n/p2+1=n(11/p1)(11/p2)\phi(n)=n-n / p_{1}-n / p_{2}+1=n\left(1-1 / p_{1}\right)\left(1-1 / p_{2}\right). This approach can be extended to numbers with more prime factors, by means of the principle of Inclusion-Exclusion (see pp. 209, 210 of NZM). Use PowerTab to view the powers of bb, invertible modulo 91 . Note that b721(mod91)b^{72} \equiv 1(\bmod 91) whenever gcd(b,91)=1\gcd (b, 91)=1, as predicted by Euler's Theorem (Theorem 2.8 of NZM). Is there a smaller exponent with this same property?

Problem 7

The program FctrlTab generates a table of the numbers k!(modn)k!(\bmod n). Use FctrlTab to view the factorials modulo 345345 . What is the least kk such that k!0(mod345345)k!\equiv 0(\bmod 345345) ? Is it necessarily the case that gcd(k,345345)>1\gcd (k, 345345)>1 ? Use Factor to determine the factorizations of kk and of 345345. Use FctrlTab to view the factorials (modp)(\bmod p) for several prime numbers pp. Is there any pattern exhibited by (p1)!(modp)(p-1)!(\bmod p) ? By (p2)!(modp)(p-2)!(\bmod p) ? By (p3)(p-3) ! (modp)(\bmod p) ? Formulate conjectures. Can you prove that each one of these conjectures implies the others? See Wilson's Theorem (Theorem 2.11 of NZM).

Problem 8

For each integer nn let k(n)k(n) denote the least positive integer kk such that k!0(modn)k! \equiv 0 (\bmod n). Clearly k(p)=pk(p)=p if pp is prime. If nn is composite then k(n)k(n) is smaller. How much smaller? Is it usually small? Is it usually large? Does it oscillate a lot? Use FctrlTab to determine k(n)k(n) for several values of nn, and interpret your findings.

Problem 9

The program PolySolv allows you to define a polynomial f(x)f(x), and then find the roots of the congruence f(x)0(modn)f(x) \equiv 0 (\bmod n). The program runs rather slowly when nn is large, since f(a)f(a) is evaluated (modn)(\bmod n) for every a,0a<na, 0 \leq a<n. Use PolySolv to find the roots of x21(modp)x^{2} \equiv 1(\bmod p) for several small primes pp, and note that the results conform to Lemma 2.10 of NZM.