O'Reilly logo

The Princeton Companion to Mathematics by Imre Leader, June Barrow-Green, Timothy Gowers

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

III.58 Modular Arithmetic

Ben Green

Is there a square number whose decimal expansion ends . . . 7? Is 438 345 divisible by 9? For which positive integers n is n2 - 5 a power of two? Is n7 - 77 ever a Fibonacci number?

These questions, and more, can be answered using modular arithmetic. Let us look at the first question. Listing the first few squares, 1, 4, 9, 16, . . . , one does not find any whose final digit is 7. In fact, writing down just the final digits, one gets the sequence

1, 4, 9, 6, 5, 6, 9, 4, 1, 0, 1, 4, 9, 6, 5, 6, . . . ,

which seems to repeat (and thus never contain the number 7).

An explanation of this phenomenon is as follows. Let n be a number to be squared. We can always write n as a multiple of 10 plus a remainder; that ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required