Saturday, September 08, 2007

Mathematics in a Jack Reacher Novel

Lee Child is the author of a series of 11 novels involving Jack Reacher, an ex-Army MP who travels around the US, shooting up bad guys, saving the good guys (and gals), all while having no fixed address and no possessions. Think of The Saint, but more laconic, and on steroids.

In the latest Jack Reacher novel, Bad Luck and Trouble, we are suddenly informed that Reacher has "some kind of a junior-idiot-savant facility with arithmetic." (This characteristic never appeared before in any other Reacher novel.) Reacher uses the number 8197 as his ATM card PIN "because [97] was the largest two-digit prime number, and he loved 81 because it was absolutely the only number out of all the literally infinite possibilities whose square root was also the sum of its digits. Square root of eighty-one was nine, and eight and one made nine. No other nontrivial number in the cosmos had that kind of sweet symmetry. Perfect."

Of course, 0 and 1 also have the property that their square root equals the sum of their digits, but Reacher apparently dismisses these as "trivial".

This kind of property -- that a number's square root equals the sum of its digits -- is exactly the kind that most mathematicians would dismiss as uninteresting. There are at least two reasons. First is the privileged position given to base-10 numeration. In base 10, the square root of 81 equals the sum of its digits, but that's not the case in base 2, where 8110 = 10100012, so the sum of the base-2 digits is 3. Why should we single out base 10, rather than some other base?

Second, the reason why 0, 1, and 81 are the only numbers with the Reacher property is essentially trivial: the sum of a number's digits grows, at most, something like 9 log10 n which, as n goes to infinity, is much less than sqrt(n). So we already know, with essentially no calculation, that there can only be a finite number of Reacher numbers in any base; the fact that there are three of them is not particularly interesting.

[Exercise: 81 also has the property that its fourth root equals the sum of its digits, when expressed in base 2. Find another number besides 0 and 1 with this property. Extra credit: explain why nobody cares.]

Elsewhere in the novel, Reacher explains how he would choose a 6-digit password:

"Six characters? I'd probably write out my birthday, month, day, year and find the nearest prime number." Then he thought for second and said, "Actually, that would be a problem, because there would be two equally close, one exactly seven less and one exactly seven more. So I guess I'd use the square root instead, rounded to three decimal places. Ignore the decimal point, that would give me six numbers, all different."

So what's Reacher's birthday? Keep in mind that, according to the novels, he seems to be between 35 and 55 years old. I'll give the answer in another post - if anybody cares.

Update: (April 3 2015). Here's a genuine mathematical question. Fix a base b, such as 2 or 10. Are there infinitely many numbers n such that n is a power of the sum of the base-b digits of n? Reacher's number 81 works in base 2 and base 10, for example. For base 2, the first few examples are 0,1, 81, 625, 7776, 16807, 46656, 59049, 1679616, 1475789056, 6975757441, 137858491849, 576650390625 and form sequence A256590 at the On-Line Encyclopedia of Integer Sequences.

Juhan said...

... where 81 base-10 = 1010001 base-2, so the sum of the base-2 digits is 3. ...
Wrong is 11 (base-2, ops ((base-10)-base-2), err...)!

Anonymous said...

Speaking of arbitrary and uninteresting conventions this 09/10/07 morning: it seems to me the month/day/two-digit-year convention is even less elegant or systematic than the base ten number system.

andrew said...

Oct 29, 1960?

102960 -7 = 102953 (prime)
102960 +7 = 102967 (prime)

round(102960^0.5*1000)=320874 (no recurring digits)

(Actually, I believe I was an undergraduate student of yours waaaaay back, so if I'm right you take partial credit)

Jeffrey Shallit said...

Yes, mugwump, that's one possibility. But if my calculations are correct, there are two other dates in 1960 that would work just as well.

andrew said...

The only other one I get is April 14th. Every other date (in '60) that matches the prime gap rule results in a PIN with recurring digits.

May depend on the rounding algorithm?

I had some reason for picking Oct 29th yesterday, but can't remember the reason.

After (scout's honour) I did the calculation I did the requisite Wikipedia search, which also shows Oct 29th, 1960 -- which is about as definitive as, oh, saying a Schopenhauer quote is valid because it gets a lot of Google hits.

Jeffrey Shallit said...

Well, I get December 18, 1960 as one other possibility. sqrt(121860) = 349.084517, which, when rounded to 6 significant digits, is 349.085.
But you're right, one could interpret "rounding" in some other way.

andrew said...

Ack. Off-by-one bug in my script. I'm getting too long-in-the-tooth for this new-fangled "programming". Yes, I got December 18th as well.

Ok, I get a third of a cookie.

DougB said...

I'm guessing Mugwump chose Oct 29, 1960 because that's the month Reacher was counting days in when he was coercing The Zec to spill the beans in that house by the stone crushing plant... in Bad Luck and Trouble.

Anonymous said...

October is correct, but the novel was not Bad Luck and Trouble ---
it was "One Shot". Somewhere between October 16th and 31st, for sure.

Red Lite

Unknown said...

you get the dweeb award
math major
harvey mudd
class of 72