Freeman Dyson and 1/19

I just read this article about Freeman Dyson and a math puzzle that asks you to find a number that is doubled when you tear off the rightmost digit and stick it on the left. For example, tearing the 2 off 12 and sticking it in front gets you 21, which isn’t 2×12, so 12 isn’t right. Moving the 1 in 7654321 gets you 1765432 which also dosn’t double it, so that’s not the number either.

Anyway, it turns out the number we’re looking for is 18 digits long. It’s 052,631,578,947,368,421 which doubles to 105,263,157,894,736,842. (You’re allowed to stick a zero in front.)

Well, my son loves this kind of base-10 number tomfoolery, so I asked him if he could figure it out. And he reeled off the answer without pause. All 18 digits.

“Uhh, how’d ya know?” I asked.

He said it’s because 1/19 is 0.052631578947368421… (repeated forever), and 2/19 is 0.105263157894736842… (just move the 1). And of course 2/19 is twice 1/19. So if you know your N/19 repeating decimals, this is apparently easy peasy. And all the N/19’s are buried in that infinite sequence. You just have to start at different places. 3/19 is 0.157894736842105263…, 4/19 is 0.210526315789473684…, 5/19 is 0.263157894736842105…, etc.

So the next time someone asks “what’s a number that’s quadrupled when you tear the last two digits off the right and stick them on the left” you can say “doy, it’s 052,631,578,947,368,421 of course” and then roll your eyes. Because you’ve seen 1/19 and 4/19 written out as decimals.

Anyway, my son also told me there’s something similar for 1/29, except you triple the number by tearing off the rightmost digit and putting it on the left. I think it’s 28 digits long.

And also for 1/39, except you quadruple (x4) the number. And with 1/49 you x5 the number, and 1/59 gets you x6. Even 1/99 (0.0101010101…) works (x10 gives you 0.1010101010…).

As for 1/109, I don’t know, I’ll bet there’s some kind of x11 trick there. My son’s in bed now, but I’ll ask him tomorrow when he gets up.

Crossing the street — what are the odds?

I needed to go to the store last weekend, and I thought I’d walk. It isn’t far and walking is good for you. I did it all the time when I lived in a city.

But to get to the store I have to cross one big street. There’s a light and a crosswalk, but it’s one of those streets where the drivers don’t expect pedestrians. And there’s always cars turning left and right even when there’s a cross signal. It’s a complicated wide busy intersection.

I’ve crossed this street before however, and I’ve never had a close call. There’s a lot going on, but I try to be super careful. I feel the risk. I wouldn’t want my kid to have to cross this street.

So I’m thinking, what if I had to cross this street every day for, say 10 years. I’d be crossing thousands of times. What are the odds that I’d be hit by a car, have really bad luck just once in all those chances?

Let’s say the odds of being hit are one in 100 million. If I cross 5 thousand times, my odds of being hit are about one in 20 thousand. I’m a little uncomfortable with that, but it feels like an acceptable risk for something spread out over 10 years.

But I think the odds are probably somewhat worse than that, maybe even as high as one in 10,000. Which would mean I have a pretty good chance of being hit over 10 years. Which negates all the health benefits of walking.

And if I shouldn’t be crossing that street every day for 10 years, I probably shouldn’t be crossing at all without a good reason.

So the problem is that you can’t rely on intuition to decide whether something like this is safe. Intuition isn’t very good at distinguishing between 1 in 10,000 and 1 in 10,000,000. Intuition isn’t very good at summing odds over 10 years. You have to think it out.

Now all I have to do is find out what the odds really are.

Infinite sums, integer sequences

Yesterday my son told me “You know Dad, when you add 1/10 + 4/100 + 9/1000 + 16/10000 forever you end up with 110/729.”

This was part of a discussion we started a year ago when I was teaching him about repeating decimals. We started easy with 1/10 + 1/100 + 1/1000 forever is 1/9, moved on to stuff like 1/9 + 1/81 + 1/729 etc is 1/8. He particularly likes 1/49, which has a 42 digit repeat and is 0.0204081633..etc or the sum of (2^n)/(100^n) where n is 1..infinity.

He also likes how 1/4 is related to 1/49 and 1/499. 1/4 is sum((2^n)/(10^n)) (n <- 1..infinity), 1/49 is sum((2^n)/(100^n)), and 1/499 is sum((2^n)/(1000^n)).

Anyway, since 1/4 is sum((2^n)/(10^n)), we briefly wondered what sum((n^2)/(10^n)) was. I didn’t know, and I forgot about it.

But my son remembered and somehow calculated it to be 110/729. Then he told me sum((n^2)/(100^n)) is 10100/(99^3). So I suggested maybe sum((n^2)/(X^n)) (n <- 1..infinity) is (X*(X+1))/((X-1)^3).

That’s kind of cool. It’s related to the fact that 1/2 + 1/4 + 1/8 + ..etc.. is 1, and 1/3 + 1/9 + 1/27 + ..etc.. is 1/2, and in general sum(1/(B^n)) is 1/(B-1) (summing over n <- 1..infinity). And also 1/2 + 2/4 + 3/8 + ..etc.. is 2, and 1/3 + 2/9 + 3/27 + ..etc.. is 3/4, and in general sum(n/(B^n)) is B/((B-1)^2). So if my guess above is right maybe we’ve caught a pattern. Take a look:

Summing over n <- 1..infinity:
  sum((n^0)/(B^n))  is  (1      /((B-1)^1))
  sum((n^1)/(B^n))  is  (B      /((B-1)^2))
  sum((n^2)/(B^n))  is  (B(B+1))/((B-1)^3)

That’s interesting. And the denominator follows the obvious pattern as we go forward. For sum((n^3)/(B^n)) it’s (B-1)^4, for sum((n^4)/(B^n)) it’s (B-1)^5, etc. As for the numerator, you’d think B(B+1)(B+2) might be next.

But it’s not. The numerator is a lot weirder than that.

Let’s look at this again:

Summing over n <- 1..infinity:
  sum((n^0)/(B^n))  is  v0/((B-1)^1) where v0 is 1
  sum((n^1)/(B^n))  is  v1/((B-1)^2) where v1 is B
  sum((n^2)/(B^n))  is  v2/((B-1)^3) where v2 is B(B+1)
  sum((n^3)/(B^n))  is  v3/((B-1)^4) where v3 is ?
  ...
  sum((n^A)/(B^n))  is  vA/((B-1)^(A+1))

Is there an easy way to describe the numerators v3, v4, v5, etc? To find out I wrote some code. You can see it here (in series.erl). Here’s what the function sum_na_over_bn_numerator (and list_close_sum_na_over_bn_numerator_for_b) told me:

For A Numerator when B is 2 Numerator when B is 3 Numerator when B is 4 Numerator when B is 5
0 1 1 1 1
1 2 3 4 5
2 6 12 20 30
3 26 66 132 230
4 150 480 1140 2280
5 1082 4368 12324 28280
6 9366 47712 160020 421680
7 94586 608016 2424132 7336880
8 1091670 8855040 41967540 145879680
9 14174522 145083648 817374564 3263031680

The first three rows are 1, B, and B(B+1) as I stated above. But the rows after that are harder to figure. If the next numerator were B(B+1)(B+2), the 4th row (where A is 3) would be 24, 60, 120, 210 instead of 26, 66, 132, 230. I don’t know of a simple expression to generate this sequence.

The column where B is 2 is the sequence [1, 2, 6, 26, 150, 1082, 9366, 94586, 1091670, 14174522, 204495126, etc]. This series is described as the Number of necklaces of sets of labeled beads (A000629) in the Encyclopedia of Integer Sequences (att.com). It is also mentioned in Stirling Number of the Second Kind (wolfram.com).

The column where B is 3 is the sequence [1, 3, 12, 66, 480, 4368, 47712, 608016, 8855040, 145083648, 2641216512, etc]. This series is also (sort of) described in the Encyclopedia of Integer Sequences (att.com) where it is called the Expansion of ln(1+sinh(x)/exp(x)) (A009362). But A009362 is not exactly the same sequence since it starts with 0 and has alternating positive and negative integers, like this: [0, 1, -3, 12, -66, 480, -4368, 47712, -608016, etc].

We can turn this table on its side with the function list_close_sum_na_over_bn_numerator_for_a and look at other integer sequences.

For B Numerator when A is 0 Numerator when A is 1 Numerator when A is 2 Numerator when A is 3 Numerator when A is 4
2 1 2 6 26 150
3 1 3 12 66 480
4 1 4 20 132 1140
5 1 5 30 230 2280
6 1 6 42 366 4074
7 1 7 56 546 6720
8 1 8 72 776 10440
9 1 9 90 1062 15480
10 1 10 110 1410 22110
11 1 11 132 1826 30624

And of course the 2nd column (where A=0) is always 1, the 3rd column is the same as B, and the fourth column is B(B+1).

The fourth column values (B(B+1)) are also known as the Pronic Numbers. In the Encyclopedia they are called the Oblong (or pronic, or heteromecic) numbers: n(n+1) (A002378).

I don’t have names for any of the other integer sequences in the tables above. I’ll list a few of them here in case someone ever googles them. (I don’t think google is very good at recognizing number sequences in table columns.)

The following lists are just google bait. Read above to find out where they came from.

Sequences from list_close_sum_na_over_bn_numerator_for_a( N ):

Sequences from list_close_sum_na_over_bn_numerator_for_b( N ):