**From New Scientist #885, 14th February 1974** [link]

Aunt Agatha’s three daughters are an argumentative lot and it is no surprise to find them all working for different political parties. They are too young for front-line stuff so they all sit outside the only polling station in their ward and write down the voters’ polling numbers on special pads. the polling numbers start at one, there are no postal voters and last time, incredible to relate, there was 100 per cent poll.

“Phew!” exclaimed Prissy for the Liberals, “I wrote down 3967 digits in all”.

“I knew you wouldn’t get it right”, retorted Emily, who is Labour. “I wrote down 3961 digits”.

“More fool you”, remarked Tory Tania, “the right tally is 3971”.

It does the girls credit that one of them not only recorded the polling numbers with complete accuracy but also added up the number of digits in them right.

How many electors are there in the ward?

[tantalizer334]

### Like this:

Like Loading...

We can easily write a constructive solution that just counts the digits.

This Python 3.10 program uses

structural pattern matchingto identify the solution. It runs in 59ms.Run:[ @replit ] (Python <3.10 version)Solution:There are 1267 voters.Manually:

There are 9 1-digit voters (1-9) = 9 digits

There are 90 2-digit voters (10-99) = 180 digits [189 digits in total]

There are 900 3-digit voters (100-999) = 2700 digits [2889 digits in total]

There are 9000 4-digit voters (1000-9999) = 36000 digits [38889 digits in total]

(In general there are

9×10^(k – 1)k-digit voters, giving a total of9k×10^(k – 1)digits).So the number of voters is 4-digits. We just need to work out how many 4-digit voters there are:

So there are 268 4-digit votes, and the correct total is 3961 (Emily).

The total number of voters is: 9 + 90 + 900 + 268 = 1267.