Calculator Magic #2
Integer Powers


No Exponent Is Too Tough


On a small calculator, extracting square root is easy; they provided a special key for it.  Taking powers of numbers is another matter.  The means do exist, but there is no explanation in the made-for-the-masses instruction manuals.  They left that task for me.

Prerequisite:  Introduction to Programming a Four-Function Calculator.


THE CONSTANT MULTIPLIER FUNCTION

Solve this sample problem:  17.1235

Did you enter  17.123 × 17.123 × 17.123 × 17.123 × 17.123 = ?
If so, then it worked, but you pressed 24 keys more than necessary.  To see why, let's start with a smaller exponent.

To calculate  4395.12, you could enter  4395.1 × 4395.1 =
Or else you could simply enter  4395.1 × = , saving 6 keystrokes in the process.  The value  4395.1, having been set as a Konstant multiplier, did not need to be reentered.

For squaring a number, this shortcut works even with a Casio, because of a simple fact involving the way that calculators work:  it is unnecessary to reenter a number that already is in the display!  The number  4395.1  was showing, so it didn't need to be typed again.  On a Casio, however, the double-entry Konstant initialization is obviated only for a power of two.

Let's try some more problems.  To calculate  4183:

418 ×(×) = =.  Each entry of an equal sign increments the exponent.

Going back to the original problem of  17.1235:

17.123 ×(×) = = = =

Now a greater exponent: 1.724:

1.7 ×(×) = = = = = = = = = = = = = = = = = = = = = = =  (that's 23 equal signs)

So utilizing the Konstant is a big improvement over the alternative; nevertheless, this last calculation was rather tedious, and it would have been even more so had the exponent been much greater.  Fortunately, there is a better way.


FACTORING THE EXPONENT

8th power, 77th power, 360th power — it really doesn't matter.  Readily factorable exponents are easily accommodated, and the smaller the prime factors, the better.  Let's try that last problem again:  1.724:

24 = 2 × 2 × 2 × 3.  So  n24  can be expressed as  (((n2)2)2)3.  This can be calculated thusly:

1.7 × = n2, call it a
× = a2, call it b
× = b2, call it c
×(×) = = c3  = n24

Each press of the multiplication key resets the K-value equal to the new total, for an overall saving of fully half the keystrokes.  Pretty nifty, eh?

In most cases, it isn't necessary to worry about factoring an exponent to the ultimate degree.  For example,  24 = 3 × 8.  Using those factors:

1.7 ×(×) = =
×(×) = = = = = = =

This routine required only two or three keystrokes more, with perhaps less mental strain.  It would, however, have been slightly better to have used factors of  4 × 6  rather than  3 × 8. Another 1 or 2 keystrokes would have been saved.  But is this niggling over key punches all that important?  On lesser exponents, it is not.  When working with a really large exponent, however, economy counts.  Consider this problem which will occur frequently when attempting to calculate the monthly payment on a 30-year loan:

Problem:  1.0083333360

360  can be factored in dozens of different ways.  Using factors such as  2 × 10 × 18, for example, would not be as good a choice as  5 × 8 × 9.  In general, if one is not going to reduce to prime factors, then the more nearly equal the choices, the better.  Let us maximize this algorithm, to see how easy it really is.  360  reduces to  2 × 2 × 2 × 3 × 3 × 5:

1.0083333 × = × = × = 8th power
×(×) = = ×(×) = = 9th power
×(×) = = = = 5th power       {19.836751}

How about that!  Only 17 or 20 keystrokes, plus the number itself.  For the record, this result is accurate to two decimal places.


WORKING WITH LESS FRIENDLY NUMBERS

What if you wished to calculate something such as  n79 ?  The exponent is prime, and that could entail pressing a lot of equal signs if the problem were approached the old-fashioned way.  The answer is to adjust the exponent to something that is friendly, which is fairly easily accomplished.  In this case,  79 = 80 − 1, so it would suit our needs to calculate  n80 ÷ n.   80 = 16 × 5, or  2 × 2 × 2 × 2 × 5.

To solve 1.2479:

1.24 × = × = × = × =
×(×) = = = =
÷ 1.24 =

Since the squaring of a number is so economical, the "friendliest" exponents are those which factors include the greatest number of twos. For example, for calculating  n67, using  64 (= 26) would be a far better choice than  68 (4 × 17)  or  70 ( 2 × 5 × 7).  Also, The calculator's Memory function can be quite handy in routines such as these.  To calculate  1.3167, restructure the number as  1.3164 × 1.313:

1.31  M+
× = × = × = × = × = × =
× MR × MR × MR =


OVERCOMING MEMORY LIMITATIONS

Your primitive device has only an 8-digit display and usually not more that 9 digits of storage, so there is a limit to the size of your calculations.  Scientific calculators have larger displays and lots more digits of internal memory; the more digits, the more expensive the unit.  But we don't have one of those, so we'll have to make do.  And we can do amazing things.  A pencil and paper will be useful as well.

If you try to calculate something such as  320, you will run out of memory.  At some point all keys except AC will cease to function, leaving the calculation incomplete; the display will have a long, possibly worthless number with a decimal point in it somewhere.  We can get around the this limitation, however, provided that we are willing to accept a lesser digital accuracy.

Does one really need to know the exact value of  9433 ?  Isn't it generally sufficient to know that the value is approximately  1.298 × 1065 ?  Probably so.  Judicious usage of Memory and the "borrowing" of decimals can achieve results such as these.  The idea is to convert interim totals to scientific notation in order to keep the number from becoming too large.  It remains only to keep track of all the accumulated powers of 10.

Solve  161812.  To begin, convert the number to scientific notation, leaving only a single digit to the left of the decimal point:  (1.618 × 1000)12.  The plan is to calculate 1.61812, then multiply it by  100012:

1.618  × = × = ×(×) = =    {321.91572}

The last digit might be different on your unit, but that's not important.  Casios retain the actual last digit, whereas others tend to round it off. What is important is the first few digits, which will be accurate.  Tacking on 3 × 12, or 36 zeros gives us our answer:  322 × 1036,  or   3.22 × 1038.

Let's finish with just one more monster number:  999.  Not bothering to factor the exponent 9, you enter:

9 ×(×) = = = = = = =

At this juncture, your display shows  {43046721}, but your sequence is only up to the  8th power.  You know that the total will overrun the display when you enter the next equal sign, but you do it anyway.  It now reads  {3.8742048}  or  {3.874204E}.  Your calculation is frozen, but the number is valid, and it always equals the display value multiplied by  108, no matter where the decimal point is located.

Now we calculate the  9th power of 3.874204 × 108. Clear the unit, then:

3.874204 ×(×) = = ×(×) = =     {196626.61}

There are formulas to determine the actual digital accuracy from calculations such as these, but they are not worth worrying about.  This one happens to accurate to 6 places; however, we're not trying to launch a space shuttle here, so we round off that number at  1.97 × 105.  That must be multiplied by 1089, or  1072, so our final answer is  1.97 × 1077.

Piece of cake. 

USING THE WINDOWS CALCULATOR

All of the detailed methods will work on the Microsoft Windows utility.  Not all are necessary, however.

Pros:

Cons:


More power to you!

four-function calculator
mathematical recreations
Babylonian square root
continued fraction
Taylor series
integer powers