Solution to May's Puzzle: Basic Arithmetic
In last month's arithmetic-themed puzzle (submitted by Denis Gobo), you were given the integers 3, 4, 5, and 6, and the basic arithmetic operators: +, -, × , ÷, and parentheses. The challenge was to come up with an expression that evaluates to 28.You could use each number only once and each operator only once.
The secret is to generate a 7 out of 3, 5, and 6, then multiply it by 4.This puzzle is confusing because it's easy to generate 7 by using 4 (e.g., 3 + 4, 4 + 6 - 3, 5 + 6 - 4), but then you're missing the 4 for the final multiplication. After you realize you need to generate a 7, then multiply it by 4, you might come up with the expression (6 - 2) × (3 + 4), but this solution doesn't meet the puzzle's requirements because it uses parentheses twice. A valid solution is 4 x (5 + 6 ÷ 3).
June's Puzzle: Remainders
Special thanks to my father, Gabriel Ben-Gan, for this month's puzzle. Find the smallest integer (n) that would yield a remainder of i-1 when divided by i, for any i in the range 2 through 10.That is, n % 2 = 1, n % 3 = 2, n % 4 = 3, ..., n % 9 = 8, n % 10 = 9, in which the percent sign (%) signifies a T-SQL modulo operator.