by H Bradley and C Higgins
A farmer has cows ear tagged 1, 2, 3, … and milks them in booths (for individual cows) also numbered 1, 2, 3, … with cows choosing their booths randomly.
The farmer had frequently noticed during milking that no cow was in a booth with a number that matched their own.
So he worked out in how many different ways this could happen. He also worked out in how many ways there would be at least one cow in a booth with a matching number.
The two answers were both less than one million and the sums of their digits were the same.
How many cows were in the herd?