The answer would be to multiply the binary code with all results from the formula Samuel used to encode the desired number, until he gets 59 as a result.
(P.s. 111011 isn't 59, it results in a semicolon if you convert it using an binary code translator. It rather states that 00110101 00111001 is 59)