From The Sunday Times, 3rd May 1992 [link]
This week, I share a find-the-next-row puzzle that is doing the rounds of dons’ whiteboards:
1
1 1
2 1
1 2 1 1
?
To avoid invasion of ivory towers, I will give you the answer:
1 1 1 2 2 1
with the explanation that, starting with the initial 1, each subsequent row is obtained by reading the previous row. Thus, row five is formed (with reference to row four) from one “one”, followed by one “two”, and terminating with two “one”s.
However, I do have four questions about the first billion rows of this sequence.
1. What is the largest digit that can be found anywhere?
2. What is the largest number of ones that can occur consecutively in any single row?
3. Repeat (2), looking for twos instead.
4. Repeat (2), looking for threes instead.
Multiply each answer by its question number and send in the total.
This puzzle is included in the book Brainteasers (2002), in which it appears in the following form:
Read me!
Consider the sequence:
1
11
21
1211
111221
312211
…
You might like to try and work out the next few terms before reading on and trying the rest of this Teaser.
In fact, having started with 1, each subsequent term simply reads the previous line. So, for example, after 111221 we note that this consists of:
three ones, two twos, one one
i.e. the next term is simply:
312211
Here are some questions about the first billion terms of this sequence:
(a) What is the largest number of consecutive ones in any term?
(b) What is the largest number of consecutive twos in any term?
(c) What is the largest number of consecutive threes in any term?
(d) What is the largest digit which can be found in any term?
[teaser1547]
Jim Randell 8:17 am on 25 April 2019 Permalink |
This puzzle can easily be solved using the [[
SubstitutedExpression()]] solver from the enigma.py library.The following run-file executes in 480ms.
Run: [ @replit ]
Solution: REAGAN = 396168.
The symbols L and C appear in the tens column, but not elsewhere, so their values can be interchanged. This gives rise to the two possible sums:
LikeLike
Jim Randell 8:41 am on 9 June 2023 Permalink |
For a faster solution we can use the [[
SubstitutedExpression.split_sum]] solver.The following run file executes in 73ms. (Internal runtime of the generated program is 1.5ms).
Run: [ @replit ]
LikeLike
GeoffR 12:20 pm on 25 April 2019 Permalink |
LikeLike
Frits 1:44 pm on 9 June 2023 Permalink |
column 3: x + N + A = .A with x = 1,2,3 so N = 8,9,0 column 2: y + O + N = E so either: N = 9, is not possible N = 8 and O = 0 and x = 2 N = 0 causes y to be zero but then O = E --> N = 8, O = 0, E = 9 and x = 2 column 4: z + A + A + N = 2G so z + A + A >= 21 - 8 so A = 6,7 using AND is divisible by three: (A, D, Y) is either (6, 7, 4) or (7, 3, 2) (A, D, Y, L+C) is either (6, 7, 4, 7) or (7, 3, 2, 9) (A, D, Y, {L, C}) is either (6, 7, 4, {2, 5}) or (7, 3, 2, {4, 5}) (A, G) = (6, 1) as A = 7 causes G to be 3 (which is same as D) so (N, O, E, A, D, Y, G) = (8, 0, 9, 6, 7, 4, 1) with {L, C} = {2, 5} This leaves R = 3LikeLike