Drexel dragonThe Math ForumDonate to the Math Forum

Ask Dr. Math - Questions and Answers from our Archives
Associated Topics || Dr. Math Home || Search Dr. Math

7 to the 1997th power

Date: 09/22/97 at 19:50:19
From: Anonymous
Subject: 7 to the 1997th power

How would you find what the 1997th power of 7 is?  It is too long to 
put into a calculator.  My eighth grade son got an assignment to 
figure out how to solve this equation.

Date: 09/23/97 at 04:26:26
From: Doctor Pete
Subject: Re: 7 to the 1997th power


This is a very odd question to be asked. What is particularly special 
about the number 7^1997?  I mean, why not ask what 105^1824 is? It 
seems to hold little more than computational value.  

I will give you the answer in its exact form. I obtained it by using, 
in some sense, a calculator. Well, it's a bit more than a calculator.  
It's a program called Mathematica, and it can calculate 7^1997, the 
output of which is as follows (with line ends edited out):

Mathematica 3.0 for Solaris
Copyright 1988-96 Wolfram Research, Inc.
 -- Terminal graphics initialized --

In[1]:= 7^1997


This is an exact answer, I hope you will take my word for it, because 
it looks like a string of random digits to me, too. There are 1688 
digits in this number. How did a program compute this value? It uses a 
concept called "arbitrary-precision computation."  The basic idea is 
that it does what we do with pencil and paper, only it has a *lot* 
more scratch paper to work on, and it's *much* faster. You see, most 
hand-held calculators have a very limited amount of memory, and the 
number of precise digits they can give is determined by their memory 
and computing speed (most calculators are *very* slow). However, a 
personal computer running a symbolic algebra program such as 
Mathematica or Maple has the memory, speed, and algorithms to do 
lengthy calculations, often with perfect accuracy.

This is not to say that computers and programs are the mathematician's 
salvation. Sure, they do things in milliseconds that would take a 
human decades or centuries, but it is the theory behind such 
computations that is of interest, not the mere action of calculating.  
For instance, Mathematica can give the first 10,000 decimal digits of 
pi in a second but it can't tell us if the digits of pi are uniformly 
and randomly distributed; that is, each digit from 0 to 9 occurs 
statistically 1/10th of the time and in total randomness. This is 
something that only mathematicians can prove or disprove, and whether 
you can calculate 10,000 digits or 8 trillion, you don't get any 
closer to the answer.

In any case, if you had nothing but a pencil and a lot of paper, you'd 
go about finding 7^1997 as follows: Find 7^2, then (7^2)^2 = 7^4, then 
((7^2)^2)^2 = (7^4)^2 = 7^8, etc. until you reach 7^1024.  Then you 
take 7^1024 and multiply it by 7^512, which you had found just one 
step before, to obtain 7^1536. Then multiply by 7^256, 7^128, 7^64, 7^
8, 7^4, and finally 7.  In other words,

     7^1997 = (7^1024)(7^512)(7^256)(7^128)(7^64)(7^8)(7^4)(7^1).

This cuts down (a little bit) on the number of multiplications you 
need to do, but time-wise, it doesn't really help too much. You'll 
notice that the binary representation of 1997 is 11111001101, which 
corresponds to the powers of two I have listed above. I leave it as an 
exercise to show if you can further reduce the number of 
multiplications, and if not, why.

Hope this helps,

-Doctor Pete,  The Math Forum
 Check out our web site!  http://mathforum.org/dr.math/   
Associated Topics:
Middle School Exponents

Search the Dr. Math Library:

Find items containing (put spaces between keywords):
Click only once for faster results:

[ Choose "whole words" when searching for a word like age.]

all keywords, in any order at least one, that exact phrase
parts of words whole words

Submit your own question to Dr. Math

[Privacy Policy] [Terms of Use]

Math Forum Home || Math Library || Quick Reference || Math Forum Search

Ask Dr. MathTM
© 1994-2015 The Math Forum