Some nights it is difficult to get to sleep. On one such night, John counted the number of LEDs (Light-Emitting Diodes) on his clock radio that was on to make each individual time from 10:00 PM to 12:59 AM. He did this instead of counting sheep. When it was 11:11, for example, he noted that 8 of the LEDs were on. During the time that John was awake from 10:00 PM to 12:59 AM, how many of the times had exactly 20 of the LEDs on?

Here is some information about John’s clock radio:

• Only times from 12:00 to 11:59 can be displayed.

• Each digit is made up of seven LEDs that are turned off or on depending on the particular digit to be displayed. The digit 2 has five of the seven LEDs on while the digit 8 has all seven LEDs on. All of the digits are shown in the diagram below.

• For times from 10:00 to 12:59, all four digits are used.

• For times from 1:00 to 9:59, only three digits are displayed. The leftmost digit is completely off for these times.

enter image description here


2 Answers 2


We can group the LED digits by number of LED's set:

2: 1
3: 7
4: 4
5: 2,3,5
6: 6,9,0
7: 8

Going by the hour, we get:


So the remaining digits must sum to:

12,16,13 respectively

And in two digits, these are:

12: 5+7, 6+6
16: impossible
13: 6+7

And so, the valid times are:

10:28, 10:38, 10:58, 10:00, 10:06, 10:09 and 12:08

So in total:



For times between 10:00 and 10:59 the last two digits need to sum 12.
Pick two out of a set: [0,6,9] [8;[2,3,5]]
Valid combinations for this are 00, 06, 09, 28, 38, 58

For times between 11:00 and 11:59 the last two digits need to sum 16.
This is impossible as even two 8s would not match that

For times between 12:00 and 12:59 the last two digits need to sum 13.
Pick two out of a set: [8;[0,6,9]]
Valid combination for this is only 08

This results in 7 matches

And as i was writing this JMP was already done


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.