Problem 7.3. The pages in a book are numbered as follows: the first sheet is two pages (with numbers 1 and 2), the second sheet is the next two pages (with numbers 3 and 4), and so on. The hooligan Petya tore out several consecutive sheets from the book: the first torn page has the number 185, and the number of the last torn page consists of the same digits but in a different order. How many sheets did Petya tear out?
Answer: 167.

Solution. Since any leaf ends with a page number that is an even number, the number of the last torn-out page is either 158 or 518. But 158 does not work, since 158 < 185. Therefore, the last page ends with the number 518. Now let's calculate the number of torn-out pages. Among the pages from 1 to 518, the pages from 1 to 184 were not torn out. Therefore, 518 - 184 = 334 pages were torn out. There are half as many leaves, which is 334 / 2 = 167.