If the digit 1 appears 171 times in the page numbering of a book, how many pages does the book have?
Every 10 pages, 1 appears in the units, and every 100 pages, the number 1 appears 10 times in the tens.

Counting the number of pages that contain the digit 1 in each range below, we have:

- 20 pages between 1-99:

1,11,21,31,41,51,61,71,81,91: 10 (1 in the unit)

10,11,12,13,14,15,16,17, 18,19: 10 (1 in the ten)

- 120 pages between 100 - 199:

101,111,121,131,141,151,161,171,181,191: 10 (1 in the unit)

110,111,112,113,114,115,116,117,118,119: 10 (1 in the ten)

100,101, 102, . ., 199: 100 (1 in the hundred)

- 20 pages between 200-299:

201, 211,221, 231, 241, 251, 261, 271, 281, 291: 10 (1 in the unit)

210,211, 212, 213, 214, 215, 216, 217, 218, 219: 10 (1 in the ten)

Up to page 299, we have $20+120+20$ times that the number 1 appears, leaving only $171-160=11$ ones, which would be the first two that appear in the unit of 301, 311, and the first nine that appear in the tens of 310, 311, 312, 313, 314, 315, 316, 317, 318. Therefore, the book has 318 pages.