Calvin writes a number with 2187 digits on the blackboard, each digit being either a 1 or 2. Susan creates a new number from Calvin's number by reading his number from left to right and wherever she sees a 1, replacing that by 112, and wherever she sees a 2, replacing that by 111.
For example : If Calvin's number begins , Susan's number would begin .
After Susan finishes writing her number, she notices that the left-most 2187 digits in her number is exactly same as that of Calvin's number. How many times do five s occur consecutively in Calvin's number?
Also try it's sister problem, an easy version: Calvin and Susan play a Number-Game #1
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Set S: Numbers Susan writes; Set C: Numbers Calvin writes
Since 1 translates to 112 and 2 translates to 111, Set S has 3 times the number of elements in Set C. Set S is a translation/mapping of Set C. Thus, first 2187 numbers of Set S are a translation of first 729 numbers of Set C. But, the first 2187 numbers of both Sets are equal! Thus, the 2187 numbers of Set C is a translation of its first 729 numbers. Similarly, the first 729 numbers of Set C is a translation of its first 243 numbers. (Same logic: First 729 numbers of Set C= first 729 numbers of Set S. But, the first 729 numbers of Set S= translation of first 243 numbers of Set C. Therefore, the first 729 numbers of Set C = translation of first 243 numbers of Set C)
From now on, the set under consideration is always Set C unless specified otherwise. The first number is 1, since both sets have to have the same first number. The 3rd term is 2, since 1 would translate into 112. The 9th term is 1, since the 3rd term would translate into 111. The 27th term is 1. . . The 729th term is 1. The 2187th term is 2.
It is also to be noted that 2 or more consecutive 2s cannot appear. This is because every part of Set C is a translation of some part before it, and a translation of any of 11, 12, 21 and 22 would not give 2 consecutive 2s.
To find: No. of 5 consecutive 1s. Translation of 11 does not give 5 consecutive 1s. 22 is not present in Set C. Also, every 12 and 21 is actually a 121. (2 consecutive 2s not possible) Translation of a 121 gives 5 consecutive 1s.
To find: No. of 121s in first 729 terms. Since 1st term is a 1, To find: No. 21s in first 729 terms. Also the 729th number is a 1.
Thus the problem reduces to finding the number of 2s in the first 729 terms. Let N(2,729) denote the required number. N(2,729) = N(1,243) (only 1 can translate to give a 2) where N(1,243) is the number of 1s in first 243 terms. N(1,243) = 243 - N(2,243) = 243 - N(1,81) = 243 - 81 + N(2,81) = 162 + N(1,27) = 162 + 27 - N(2,27) = 189 - N(1,9) = 180 - 9 + N(2,9) = 180 + N(1,3) = 180 + 3 - N(1,1) = 182 Since the number of 1s in the first 1 term(s) is 1.
The answer is 182.