O'Reilly logo

Inside Microsoft® SQL Server® 2008: T-SQL Querying by Lubor Kollar Itzik Ben-Gan Dejan Sarka, and Steve Kass

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Puzzle Solutions

This section contains solutions to the logic puzzles.

Puzzle 1: Remainders

When solving such a problem, try first to relax the limitations and simplify the problem. Then add complexity layers. For example, first ignore the requirement to find the minimum integer n that qualifies. Try to find a solution for any integer n that would yield the remainder i – 1 for any i value. Obviously, if you multiply all i values (2 × 3 × 4 × 5 × 6 × 7 × 8 × 9 × 10) and subtract 1, the result meets the puzzle’s requirement (except for the requirement to find the minimum n). You can express the same result as the product of the prime factors of the various i values: (2 × 3 × [2 × 2] × 5 × [2 × 3] × 7 × [2 × 2 × 2] × [3 × 3] × [2 × 5]) – 1. Next, tackle ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required