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 to me.

Prerequisite: Introduction to Programming a Four-Function Calculator.

THE CONSTANT MULTIPLIER FUNCTION

Solve this sample problem: 17.123^{5}

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.1^{2}, 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 requirement is obviated only for a power of two.

Let's try some more problems. To calculate
418^{3}:

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

Going back to the original problem of 17.123^{5}:

17.123 ×(×) = = = =

Now a greater exponent: 1.7^{24}:

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.7^{24}:

24 = 2 × 2 × 2 × 3. So
n^{24} can be expressed as
(((n^{2})^{2})^{2})^{3}.
This can be calculated thusly:

1.7 × = | n^{2}, call it a |

× = | a^{2}, call it b |

× = | b^{2}, call it c |

×(×) = = | c^{3} = n^{24} |

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 one or two 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 resolve a financial calculation such as the
monthly payment on a ~~30-year~~ home loan:

Problem: 1.0083333^{360}

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 factors 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, or to the penny!

WORKING WITH LESS FRIENDLY NUMBERS

What if you wished to calculate something such as
n^{79}? The exponent is prime, and that could
entail pressing a lot of equal signs if the problem were approached the
~~old-fashioned~~ way. The solution 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
~~n~~
^{80} ÷ n.~~80 = 16 × 5,~~ or
~~2 × 2 × 2 × 2 × 5.~~

To solve 1.24^{79}:

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
n^{67}, using ~~64 (= 2~~
would be a far better choice than ^{6})~~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.31^{67}, restructure the number as
~~1.31~~^{64} × 1.31^{3}:

1.31 M+

× = × = × = × = × = × =

× MR × MR × MR =

OVERCOMING MEMORY LIMITATIONS

Your primitive device has only an 8-digit display and usually not more than 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. We don't have one of those, however; so we'll have to make do, and we can do amazing things. A pencil and paper can be useful as well.

If you try to calculate something such as 3^{20},
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
94^{33} ? Doubtless it is sufficient to know that
the value is approximately ~~1.298 × 10~~.
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.^{65}

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

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 × 10^{36}, or
3.22 × 10^{38}.

Let's finish with just one more monster number:
~~9~~.
For clarification, that construct will be processed as
^{99}~~(9~~,
not ^{9})^{9}~~9~~.
(That second number is more than 10 million times greater than the first!)^{(99)}

Not bothering to factor the exponent 9 in this case, 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**
10^{8}, no matter where the decimal point is
properly located.

Now we calculate the 9th power of 3.874204 ×
10^{8}. 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 be
accurate to 6 places; however, we're not trying to launch a space shuttle here,
so we round off that number at
1.97 × 10^{5}. That must be multiplied by
(10^{8})^{9}, or
10^{72}, so our final answer is
~~1.97 × 10~~^{77}.

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:

- 32-bit math means more accurate answers.
- 4-key memory setup.
- No memory restrictions. No scientific-notation conversion is required for large numbers. Just work with the actual values.
- The Konstant Multiplier is enabled by a single keypress, and no
double-
**×**is required to initialize it.

Cons:

- No Konstant functions for Addition, Subtraction, or Division.

More power to you!