You're reading: cp's mathem-o-blog

Exactly how bad is the 13 times table?

Let’s recite the 13 times table. Pay attention to the first digit of each number:

13,26,39,52

What happened to 4

A while ago I was working through the 13 times table for some boring reason, and I was in the kind of mood to find it really quite vexing that the first digits don’t go 1,2,3,4. Furthermore, 400÷1331, so it takes a long time before you see a 4 at all, and that seemed really unfair.

I was being pretty unreasonable in my expectations of basic arithmetic, but I wasn’t completely brain-dead: I smelled an integer sequence! How about

a(n) = least k such that k×n starts with a 4.

That’s not particularly interesting, and someone who comes across this sequence in the OEIS might think “why 4?” So, I did a bit more thinking and came up with this:

a(n) = least k such that {first digit of j×n,0jk}={0,1,2,9}

I wrote a bit of Python, and in a few minutes I had some numbers:

n 1 2 3 4 5 6 7 8 9 10 11 12 13
a(n) 9 45 27 23 18 15 13 12 9 9 9 42 62

And hey, 13 is a record-setter. I’m really beginning to dislike this number. Anyway, I searched the OEIS for my sequence and it wasn’t there, so I submitted it and it was duly accepted as A249067.

Along the way, OEIS editor Charles R Greathouse IV added this intriguing conjecture:

Conjecture: a(n)N for all n. Perhaps N can be taken as 81.

Why 81? Maybe look at the graph produced automatically by the OEIS:

Pin plot of A249067(n) from n=0 to 200. The highest value is a(112) = 81The record of 81 is reached at a(112). And at a(1112). And a(11112). That’s because they’re very slightly bigger than 19×10m, so nine times 112 is just bigger than 99, i.e. a number starting with a 1, so it takes nine times nine steps down the times table before you see a number with 9 as its first digit.

This pattern repeats at every power of 10, and in fact every pattern in this sequence repeats (more or less) at every power of 10: this animated plot of the sequence with different horizontal scales shows that it’s self-similar:

Animation showing plots of a(n) up to increasing powers of 10. The structure of the plot looks similar at different scales

(The fuzziness in the bigger plots is because each plot just takes a sample of points, and interpolates between them)

So the conjecture looks true, and this is my sequence, so I should prove it.

It isn’t surprising that this thing repeats when you multiply by 10: we’re only looking at the first digit, and obviously the first digit of n is the same as the first digit of 10n. That doesn’t suffice as a proof of Charles Greathouse’s conjecture though: numbers which don’t end in a 0 might do something unhelpful.

Fortunately, the day after I thought this sequence up was MathsJam night. I decided I’d set the Charles Grey pub’s brightest minds on the problem. I had a few ideas but I’m not particularly quick at putting thoughts together.

Ji proposed an application of the pigeonhole principle: if you look at the first two digits of the numbers you see in n’s times table, you can write out everything you might see in a 9×10 grid:

101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899

The n times table will dance around this grid until all nine rows have been visited. The longest it can do that is by visiting all 80 cells not in the last line. If the process doesn’t visit the same place twice before it hits every row, that means that the latest you can put off visiting the last row is the 81st iteration. So we need to show that you can’t visit the same spot twice before visiting each row once.

Unfortunately, that’s not true. The 12 times table visits the ’12’ cell at 12×1=12 and again at 12×10=120, before all possible first digits have been seen.

So, we need another explanation.

Katie Steckles and the Manchester MathsJam crowd came up with an alternate explanation: if you can prove 1910m (that is, 112, 1112, ) takes 81 steps for all m3, then that’s the maximum, as any m-digit number bigger than that will reach 9×10m in at most as many steps, and will definitely have seen all the other initial digits before then, and any m-digit number smaller than 1910m will visit every first digit in the first 9 multiples.

There’s some evidence for this: the m+3-digit numbers that take 81 steps seem to be the ones between 11112 and 11249999.

I don’t know if there’s a clever way of showing that 1910m takes 81 steps, but would it convince you if I said that 112 takes that long, and adding more 1s in the middle can’t make it any worse? Anyway, that’s good enough for me.

I think I can now answer my question: exactly how bad is the 13 times table? Let’s compute the record-setters for A24097: the numbers that take longer than any smaller number to see every possible leading digit:

n 1 2 13 112
a(n) 9 45 62 81

13 is a record-setter in the sequence, which means it’s pretty bad, but it’s not the worst: we’ve shown above that 112 takes the longest possible number of steps to see every digit. And the number 2 comes under scrutiny for taking way longer than its neighbours. So really, 13 is just unlucky to find itself in such company.

If you’re interested in the working-out I did for this post, I’ve put my Jupyter notebook online.

2 Responses to “Exactly how bad is the 13 times table?”

  1. Avatar Christian Lawson-Perfect

    David Cushing had a hunch that the maximum number of steps in base k would be (k1)2 (so in base 10, the maximum is 92=81). I’ve checked up to base 25, and that hunch seems to be right.

    Reply

(will not be published)

LATEX: You can use LaTeX in your comments. e.g. $ e^{\pi i} $ for inline maths; \[ e^{\pi i} \] for display-mode (on its own line) maths.

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>