WoodCentral Forums

Est. 1998 — 27 years of woodworking knowledge

Second Friday Puzzler -- leading digits

Posts

Second Friday Puzzler -- leading digits

#1

Second Friday Puzzler -- leading digits

Alex Y

John was all over that last one, so maybe I better post another! This one is mathematical, but unlike the box puzzle, doesn't require extensive calculation or manipulation.

For some integers "n", 2^n and 5^n have the same leading digit. What are the possibilities for that leading digit?

Full credit : deducing the answer(s)

2/3 credit: using a computer to find n's for which this is true, and examining enough of them to convince yourself the you have all the possibilities, then coming on the "aha" that tells you why this is true.

1/3 credit: using the computer to find the answer(s), and just hoping there are no other answers for other values of n.

Re: Second Friday Puzzler -- leading digits

#2

Re: Second Friday Puzzler -- leading digits

Larry Barrett

Any credit for deducing at least one of the answers and hoping there are no others?

Re: Second Friday Puzzler -- leading digits

#3

Re: Second Friday Puzzler -- leading digits

Alex Y

Nah, if you've gotten that far, you are nearly there. Wouldn't want to give part credit and dissuade you from keeping at it! ;)

Re: Second Friday Puzzler -- leading digits

#4

Re: Second Friday Puzzler -- leading digits

Jim Rutten

I'll take the low hanging fruit and say zero and one would fit the bill.

Re: Second Friday Puzzler -- leading digits

#5

Re: Second Friday Puzzler -- leading digits

Alex Y

Conventional representation of integers prohibit zero from being the leading digit.

Can you give an "n" for which 2^n and 5^n both begin with 1?

Re: Second Friday Puzzler -- leading digits

#6

Re: Second Friday Puzzler -- leading digits

Bill Earl

>Conventional representation of integers prohibit zero from being the leading digit.

I believe the conventional definition of integers includes zero. And that x^0 for any x is 1. So I'm with Jim on that one.

As for others... Still working on that.

Re: Second Friday Puzzler -- leading digits

#7

Re: Second Friday Puzzler -- leading digits

Alex Y

Double "doh" on my part, and apologies to Jim.

My statement of the problem should have said "for some positive integers n"

But as stated, I agree that 1 works for n=0.

Re: Second Friday Puzzler -- leading digits

#8

Re: Second Friday Puzzler -- leading digits

Larry Barrett

The puzzle is asking for the "possibilities for the leading digit" - that is, where the leading digit of 2^n and 5^n are the same, for integer values of n.

I think the answer is 1 and 3, which occur when n=0 and n=5.

My approach so far has been to look at the binomial expansion of (2^2 - 2)^n and (2^2 + 1)^n, but no aha's so far.

Re: Second Friday Puzzler -- leading digits

#9

Jim's got the first one

Alex Y

n=0 gives 1 as the leading (and only) digit of 2^n and 5^n.

Re: Second Friday Puzzler -- leading digits

#10

Larry has identified another

Alex Y

2^5 = 32

5^5 = 3125

Both have a leading digit of 3

Can anyone find another or say why these are the only possibilities for the leading digits?

Re: Second Friday Puzzler -- leading digits

#11

Re: Larry has identified another

Jim Rutten

First, I want to admit to totally cheating on this. I created a spreadsheet. In the first 100 positive integers I found 5 that I believe qualify for the answer. Besides 5 which was already identified, I found 15, 78, 88, and 98 met the criteria. Interestingly, 108 and 118 also qualified. I believe the ultimate answer to this is an infinite amount of answers but I find it facinating that the answers appeared to be grouped in chunks around the last digit (the 5 in 5 and 15 and the 8 in 78, 88, 98, 108, 118). I numbered my spreadsheet all the way to 500, but my eyes got tired.

Re: Second Friday Puzzler -- leading digits

#12

Re: Larry has identified another

Alex Y

Not cheating at all. But remember the question is not to find the "n"s, but rather whether there are limited number of possibilities for the first digit, and if so, why. Do you have any conclusions about the first digits?

I agree that there are almost certainly an infinite number of n's for which 2^n and 5^n share the same first digit. And I agree that 5,15, and 78 are the first three non-zero n's for which this is the case (I didn't look any further, but understand why the pattern you see on final digits of the n's is likely to occur.)

Re: Second Friday Puzzler -- leading digits

#13

Re: Larry has identified another

Larry Barrett

Jim, this isn't 'totally cheating', this gets you 1/3 credit (at least). I did the same thing, after giving up on deducing the answer. I found the same sets of exponents you did, and more. They all result in the same leading integer for 2^n and 5^n, namely 3. If you look at the leading integer pattern where the exponent is n-4, n-3, n-2, and n-1 for the cases you found you will see essentially the same repeating pattern. But it is not completely predictable, and doesn't repeat in exactly the same way.

It is tempting to say that 3 is the only possibility where 2^n and 5^n have the same leading integer, but I can't prove it.

Re: Second Friday Puzzler -- leading digits

#14

Why three?

Alex Y

Larry speculated correctly that 3 is the only possible shared leading digit for n's greater than 0, and Jim surely saw the same with the number of cases he identified.

But why is that the case?

Re: Second Friday Puzzler -- leading digits

#15

Re: Why three?

Bill Earl

Why indeed.

I took a few minutes and wrote a program to crank out a few more examples. It appears to confirm the '3' hypothesis. At least within the limits of double-precision math.

Not sure if it has anything to do with the question, but the grouping of 'n's is interesting:

0: 1 1

5: 32 3125

15: 32768 30517578125

78: 3.02231454903657E+23 3.30872245021211E+54

88: 3.09485009821345E+26 3.23117426778526E+61

98: 3.16912650057057E+29 3.15544362088405E+68

108: 3.24518553658427E+32 3.08148791101958E+75

118: 3.32306998946229E+35 3.00926553810506E+82

181: 3.06499108173178E+54 3.26265223399926E+126

191: 3.13855086769334E+57 3.1861838222649E+133

201: 3.21387608851798E+60 3.11150763893057E+140

211: 3.29100911464241E+63 3.03858167864314E+147

274: 3.0354201441027E+82 3.29443685725954E+191

284: 3.10827022756117E+85 3.21722349341752E+198

294: 3.18286871302263E+88 3.14181981779055E+205

304: 3.25925756213518E+91 3.06818341581108E+212

367: 3.00613450595051E+110 3.32653112500637E+256

377: 3.07828173409332E+113 3.24856555176403E+263

387: 3.15216049571156E+116 3.17242729664456E+270

397: 3.22781234760864E+119 3.09807353187945E+277

407: 3.30527984395124E+122 3.02546243347603E+284

Re: Second Friday Puzzler -- leading digits

#16

Re: Why three?

Larry Barrett

Look at the pattern of leading digits between the cases where 3 is the leading digit (eg 201 and 211). The pattern is the same in these examples. Note that 221 is almost another case with leading digits = 3. It seems to be a repeating sequence every 10n, starting at 5. But not quite 10n. It makes me wonder if 3 is really the only answer.

n.....2^n..............5^n

201 3.21388E+60 3.1115E+140

202 6.42775E+60 1.5558E+141

203 1.28555E+61 7.7788E+141

204 2.5711E+61 3.8894E+142

205 5.1422E+61 1.9447E+143

206 1.02844E+62 9.7235E+143

207 2.05688E+62 4.8617E+144

208 4.11376E+62 2.4309E+145

209 8.22752E+62 1.2154E+146

210 1.6455E+63 6.0772E+146

211 3.29101E+63 3.0386E+147

212 6.58202E+63 1.5193E+148

213 1.3164E+64 7.5965E+148

214 2.63281E+64 3.7982E+149

215 5.26561E+64 1.8991E+150

216 1.05312E+65 9.4956E+150

217 2.10625E+65 4.7478E+151

218 4.21249E+65 2.3739E+152

219 8.42498E+65 1.1869E+153

220 1.685E+66 5.9347E+153

221 3.36999E+66 2.9674E+154

Re: Second Friday Puzzler -- leading digits

#17

The "near periodicity"

Alex Y

of the threes coming up is because 2^10 ~= 1,000 and 5^10 ~= 10,000,000 Thus the threes come up every ten n's, until it goes "off cycle", and it takes a while (15 to 78 eg) to come back around, then it's every ten again for a while.

Re: Second Friday Puzzler -- leading digits

#18

Re: The "near periodicity"

Larry Barrett

That explains the 3. But the other possibility for same leading digit would seem to be 1; e.g. as you point out, 2^10 ~ 1000 and 5^10 ~ 10000, and the leading digit is 1.

Here are the next in the series:

2^10 ~ 1.024 x 10^3, 5^10 ~ 9.76 x 10^6

2^20 ~ 1.048 x 10^6, 5^20 ~ 9.53 x 10^13

2^30 ~ 1.073 x 10^9, 5^30 ~ 9.31 x 10^20

You can see that the leading digit for 2^10n is slightly more than 1 and is increasing, while the leading digit for 5^10n is slightly less than 10 and is decreasing. If it were slightly less than 10 but increasing I think for some n they would have the same leading digit (1), but looks like that is not the case.

Re: Second Friday Puzzler -- leading digits

#19

Hint

Alex Y

Bill has provided a large list of 2^n and 5^n that share the same first digit. Examine those and you will see that those pairs (other than n=0) are defined by a condition that is stronger than the same first digit.

Re: Second Friday Puzzler -- leading digits

#20

Big hint

Alex Y

What is the product of the two numbers you are finding?

Re: Second Friday Puzzler -- leading digits

#21

Re: Big hint

Larry Barrett

THAT is a pretty good hint; I couldn't see the forest for the threes.

👍 This page answered my questions

Your vote helps other woodworkers quickly find the answers and techniques that actually work in the shop.