Medium | General |

I guessed 3 natural numbers - x,y,z. You can ask me 2 sums of these numbers with any integer coefficients - (a,b,c). That is, you give me a, b and c and I tell you the result of the expression a*x+b*y+c*z. Seeing the answer, you then give me the 2nd triplet of (a,b,c) & I will tell a*x+b*y+c*z. Give me the algorithm to find x,y and z.

Hint

If digits are small, we can solve any number of variables by asking a=1, b=10^100, c=10^200 etc just by reading these numbers between the zeros of result.

Solution

Since they are natural numbers, if you knew the maximum number of digits any of them can have, say d, you could set a=1, b=10^d, c=10^2d, and you would be able to read the d-digit numbers directly. So, you use the first calculation to find the maximum number of digits, (a,b,c)=(1,1,1). let d = digits of this result (x+y+z)

Then, set (a,b,c) = (1, 10^d, 10^2d) Let the sum be S.

Then x = (first d digits of S), y = [d+1] to 2d-digits of S, z = [2d+1 to 3d] digits of S

Thus, we note that its posssible to solve for n natural numbers x_1,x_2,...x_n with just 2 questions.

Then, set (a,b,c) = (1, 10^d, 10^2d) Let the sum be S.

Then x = (first d digits of S), y = [d+1] to 2d-digits of S, z = [2d+1 to 3d] digits of S

Thus, we note that its posssible to solve for n natural numbers x_1,x_2,...x_n with just 2 questions.

Source: Quantnet Forums

Enable Like and Comment Medium | General |

What is/are the next term(s) in the sequence:

a) 1, 11, 21, 1211, 111221, ?

b) 10, 11, 12, 13, 14, 20, 22, 101, ?, ?

c) (This a sequence made by only 2 & 1): 2,2,1,1,2,1,2,2,1, ?, ?....

a) 1, 11, 21, 1211, 111221, ?

b) 10, 11, 12, 13, 14, 20, 22, 101, ?, ?

c) (This a sequence made by only 2 & 1): 2,2,1,1,2,1,2,2,1, ?, ?....

Hint

a) base-change, b) count numbers, c) count repetition

Solution

a) 1, 11, 21, 1211, 111221, 312211, 13112221, 1113213211, …

This is a Look-and-say sequence! To generate a member of the sequence from the previous member, read off the digits of the previous member, counting the number of digits in groups of the same digit.

b) 10, 11, 12, 13, 14, 20, 22, 101, 1010, 1111111111

This is '10' written in different bases, from 10 to 1!

c) This a sequence made by only 2 & 1: 2,2,1,1,2,1,2,2,1, ?, ?....

This is a version of Kolakoski sequence, and is its own run-length encoding. Each symbol occurs in a "run" of either 1 or 2 consecutive terms, and writing down the lengths of these runs gives exactly the same sequence. It is the unique sequence with this property except for the same sequence with extra '1' at start.

This is a Look-and-say sequence! To generate a member of the sequence from the previous member, read off the digits of the previous member, counting the number of digits in groups of the same digit.

b) 10, 11, 12, 13, 14, 20, 22, 101, 1010, 1111111111

This is '10' written in different bases, from 10 to 1!

c) This a sequence made by only 2 & 1: 2,2,1,1,2,1,2,2,1, ?, ?....

This is a version of Kolakoski sequence, and is its own run-length encoding. Each symbol occurs in a "run" of either 1 or 2 consecutive terms, and writing down the lengths of these runs gives exactly the same sequence. It is the unique sequence with this property except for the same sequence with extra '1' at start.

Source: Common

Enable Like and Comment Latest solved Puzzles

Color Switches Weird Sequences Intersecting Pillars Consecutive sums Scaling a Square Difficulty Level

© BRAINSTELLAR |