republicofmath 2^n begins with 9 for n = 53, 63, 73, 83, 93, 156, 166, 176, 186, 249, 259, 269, 279, 289, 352, 362, 372, 382, 445, 455, 465 …
#MathsJam
My answer was short and straight to the point (I had used Mathematica) but not explanatory:
x
x
Barb Lynch, from Northeast Ohio, USA, is a teacher of algebra 1 and geometry to G/T middle school students. Chances are Barb does not have an available copy of Mathematica, and it’s highly likely her students do not have access to Mathematica even if she does.
x
So, if we are to adopt a computational solution to finding the powers of 2 that begin with 9, it would be handy to have another computational engine that students did have access to.
x
Enter a spreadsheet.
I will use Excel, but an open source spreadsheet, including that on
Google Docs will do.
x
All we need from a spreadsheet is built-in functions for:
- logarithms to the base 10
- finding the whole number part of a decimal number
- the ability to form powers.
All spreadsheets can do these things.
The idea is that we will generate a list of powers of 2 and examine that list to see which entries begin with a 9.
x
The one trick we need is to figure out how to extract the leading digit from a number such as “123′ when it is written in the spreadsheet.
x
Of course as human beings we just look to the left and speak the digit.
x
The question is: how do we instruct a spreadsheet to to do that?
x
The answer, it turns out, is surprisingly easy, using the miraculous powers of indices (otherwise known by the mysterious name of “logarithms”).
x
Here’s the idea:
- To figure out how many powers of 10 are involved in a number such as 123, we take the logarithm, base 10, of the number. This makes sense because . So, for example, .
- To figure out what whole number of powers of 10 are involved in a number, such as 123 we drop the fractional bit of to get 2. To do this in the spreadsheet we use the function “int” which takes the integer part of a decimal number.
- Now we have now that 123 is in the range we need to divide by this number to figure how many of these powers of 10 we have. So we divide 123 by to get 1.23.
- Now we are pretty much there: if we take the integer part of this number, using “int” we get 1. Voila! We have the leading digit of our number.
So here’s a how we might implement this in a spreadsheet (click on the image to enlarge it):
What do these spreadsheet formulas mean?
- In the first column we are just creating a list of integers 1, 2, 3, 4, … by beginning with 1 and adding 1 at each step.
- In the second column we are forming where n is the corresponding entry in the first column.
- In the third column we are taking the logarithm, base 10, of the corresponding number in the second column.
- In the fourth column we are finding the whole number part of the decimal number in the third column.
- In the fifth column we are dividing the corresponding number in the second column () by 10 raised to the power in the fourth column.
- In the sixth column we are taking the whole number part of the decimal number in the fifth column.
- In the seventh column we asking the spreadsheet to say “YES” if the number in the sixth column is 9 (and “NO”otherwise)
When we do this without displaying formulas, ax I have done above, but just showing numbers, we see that a “YES” first appears at n = 53, and another “YES” appears soon after at n = 63 (click on the image to enlarge it):
x
That’s it, from a computational perspective.
x
Pretty soon a spreadsheet will not be able to accurately calculate large powers of 2, so another computational engine needs to be used. That’s a story for another time.