# And it seems to be working binarycom has recorded some impressive numbers in recent years

A common exercise in number theory is to find the last digits of a large power, like 2without using a computer.

So how do you find its last digits — efficiently? Modular arithmetic, and in particular, modular exponentiationcomes to the rescue. It provides an efficient way to find the last m digits of a power, by hand, with perhaps only a little help from a pocket calculator.

All you need to do is compute the power incrementally, modulo 10 m. In this article, I will discuss three methods — all based on modular exponentiation and the laws of exponents — for finding the ending digits of a positive power of two. The techniques I use are easily adapted to powers of any number. In this method, you reduce a power of two modulo 10 m repeatedly until you get a congruent power, or product of powers, for which the end digits are known — or easily computed.

You use your knowledge of smaller powers of two, in conjunction with and it seems to be working binarycom has recorded some impressive numbers in recent years power of a power and product of powers rulesto set up easier sub problems to solve. You start by dividing the exponent of 2 n by the exponent of a known, smaller power of two, 2 agetting a quotient q and a remainder r. I call them the powers of two method and the powers of six method.

In the powers of two method, you reduce a power of two by using a power of two ending in 2. This reduces the problem at each stage to a smaller power of two, giving the method a recursive feel.

The intermediate powers of and it seems to be working binarycom has recorded some impressive numbers in recent years are in effect nested. Soshowing that 2 ends in 2. The intermediate results — 22 812 17and 2 5 — are all congruent, ending in 2. If you recognize this along the way, you can stop.

For example, if you happen to know that 2 17 is , you can stop after the third step. Any power of two ending in 2 works. Using 2 9there is one less step, but the arithmetic is slightly harder division by 9 instead of division by 5. In the powers of six method, you reduce a power of two using a power of two that ends in 6. The first step would give:. All powers of six end in 6 6 times 6 mod 10 is 6, and around it goes…so we just and it seems to be working binarycom has recorded some impressive numbers in recent years this into a very simple problem: The powers of six method does not apply to modbut the powers of two method does — indirectly.

Although there is no power of two that ends in 02, we can use any two-digit ending that is a power and it seems to be working binarycom has recorded some impressive numbers in recent years two; we just convert it to 2 y using the laws of exponents.

Consulting a table of positive powers of twofind a power of two that ends in 04; for example, 2 22 4, For the last m digits, find an m-digit power of two m digits including leading zeros greater than or equal to 2 m and convert it to 2 y as above. Of course, the remainders will become larger and larger as the modulus increases.

The method of successive squaringalso called repeated squaring or binary exponentiationis a very systematic way to do modular exponentiation. This process is independent of the number of ending digits m, although you have to deal with bigger and bigger numbers as m increases. I wrote out the whole list for completeness, but it was unnecessary to go beyond 2 4.

Notice that the powers in this list cycle after a point, so it is not necessary to compute them all. I could have used negative numbers in the intermediate steps to make the math easier; for example, -4 instead of Both are congruent mod There are two ways to use the cycle information, in techniques I call the table method and the base power method. In the table method, you compute the powers of two mod 10 m in sequence, until the ending digits cycle.

You label entries sequentially starting at m, wrapping around 0 to end at m — 1. The last m digits of 2 n are the digits in the table with the label corresponding to that remainder.

The last digit of the positive powers of two cycles with length 4, and. According to the table, a remainder of 1 corresponds to a last digit of 2. Almost as simply, we can find the last two digits of 2 The last two digits of the positive powers of two cycle with length 20, and.

According to the table, a remainder of 9 corresponds to the ending digits The table method works for any number of ending digits, but beyond two or three, is impractical. The tables grow large, by a factor of five for each additional ending digit. You need to determine which power of two in this range it is — what I call the base power of two — and then use another method to find its ending digits.

You can find the base power of two directly: Trivially, we can see the ending digit is 2. For the last two digits of 2compute. The last two digits are I said find the last digits without using a computer, right? It took an instant — here it is:. The three methods provide shortcuts to the answer, exploiting knowledge of the laws of exponents and the cycling of ending digits.

Which method should you use? The ad hoc method is the least systematic but allows for case-by-case optimization. The method of successive squaring is the most systematic but may be overkill for certain problems.

Learn all three methods to get a deeper understanding, then decide which one you like. For finding the **and it seems to be working binarycom has recorded some impressive numbers in recent years** digit, I like the ad hoc powers of six method. It is the quickest. The powers are written with exponents example: She did also some other interesting relations.

But I have never found time to encourage and help her to publish it…Anyway, I feel proud of her. Now I think it is worth going trough her old notes because she did some other interesting thigs too. I hope that her mathematical talents were recognized and nurtured by her teachers, and I hope she is still interested in math and I hope she is pursuing a math related career!

These are clearly shown for powers of two. Is there any book which has all the workouts of such problems. Do you mean for other powers?

Thank you sir for the reply. Yes sir they come under Number theory and i have a book by Tom M Apostol but however they mainly discuss about the theory, so i have asked that question. Since is itself a power of two, you will have your answer immediately when you finish the list no combining required. Give it a try and let me know how it works out. From a math illiterate … divined by staring into Excel. If anyone else has posted this please ignore — I did not read through all comments.

Just calculate the remainder of the exponent in the particular modulus 10, etc. So you can now proceed with your algorithms, or simply use the well-known fast algorithm for modular exponentiation. It works pretty much the same way the fast algorithm for the usual exponentiation. It uses the observation that, if you have, for example, something like this: Just calculate it once and square the result that is, multiply the current result by itself: Awesome article and i am impressed!

Your article really helped me to go through the school assignments and its quite logical! Can you please publish another article on other no.

Thanx and Appreciate it bro! Your email address will not be published. Skip to content A common exercise in number theory is to find the last digits of a large power, like 2without using a computer.

Ad Hoc Exponentiation In this method, you reduce a power of two modulo 10 m repeatedly until you get a congruent power, or product of powers, for which the end digits are known — or easily computed. Get articles by e-mail. What did you have in mind? Very interesting and thorough. Dimitrina, I hope that her mathematical talents were recognized and nurtured by her teachers, and I hope she is still interested in math and I hope she is pursuing a math related career!

Thanks for the feedback. Jagan, Do you mean for other powers? Every 4th number has its last digit as a 6. Leave a Reply Cancel reply Your email address will not be published. My Custom Binary Themed Calendar for