Counting Pages of a Book Task
Given the page of a book P on stdin, count all occurrences of the digits 0-9 in each member of the range 1 to P. There is no page zero and your program should handle any number less than 1,000,000. Since putting a constraint on how you can do it is difficult to explain there will be a time limit of 3 seconds instead. That may be too short for some of the answers already submitted but mine runs faster than that so it is possible.
Examples (plus a list of the occurences):
input: 10

0 = 1  (10)
1 = 2  (1, 10)
2 = 1  (2)
3 = 1  (3)
4 = 1  (4)
5 = 1  (5)
6 = 1  (6)
7 = 1  (7)
8 = 1  (8)
9 = 1  (9)


input: 20

0 = 2  (10, 20)
1 = 11 (1, 10, 11 ... 18, 19)
2 = 3  (2, 12, 20)
3 = 2  (3, 13)
4 = 2  (4, 14)
5 = 2  (5, 15)
6 = 2  (6, 16)
7 = 2  (7, 17)
9 = 2  (8, 18)
Matlab, 43 bytes

y=hist(+num2str(1:input('')),47:57);y(2:11)


Example:

&gt;&gt; y=hist(+num2str(1:input('')),47:57);y(2:11)
10
ans =
     1     2     1     1     1     1     1     1     1     1


How it works:

1:input('') generates a vector of numbers from 1 to the input number.

num2str converts all those numbers to a space-separated string (char array).

The + converts from char to ASCII codes. Digits are 48 to 57 in ASCII.

hist counts how many times each of those ASCII codes appears. Actually the count for value 47 is necessary too, because hist collects all lower values in the first bin. So that 47 just intercepts all spaces and prevents them from being confused as zeroes.

Lastly, y(2:11) removes that first count and prints the result.