A friend gave me this riddle, stating that it would be easy for children but hard for grown-ups.

Any combination of four digits has an determined value. Here are some examples (note, the position of the example is of no relevance):

0000 = 4
0001 = 3
1111 = 0
1234 = 0
2266 = 2
4068 = 4
6666 = 4
6088 = 6
7654 = 1
8888 = 8
8901 = 4
9966 = 4
9998 = 5


You may ask for any other four-digit number and there is a determined value for it as well. What is the value-function based upon?

• It was pretty easy for adults too :) – A.D. May 8 '15 at 14:21
• Right, but he didn't have a whole community that is puzzler-affine only waiting for such an easy bit ;) – Dennis May 8 '15 at 14:23
• that's very true – A.D. May 8 '15 at 14:26

The value is:

How many circles appear within the numbers

Explanation:

Each number corresponds with a value, and they are additive for the final value of the 4 digit string. 0, 6, and 9 map to 1. 8 maps to 2, everything else maps to 0. This value for each digit is the number of circles within the drawing of the digit

• I was writing the same thing :) good job – A.D. May 8 '15 at 14:18
• That was even quicker than I'm allowed to accept answers! Edit: and also correct. – Dennis May 8 '15 at 14:21

I think the solution is

The sum of each number circles

Explanation:

0 has 1 circle
1 has no circles
2 has no circles
3 has no circles
4 has no circles
5 has no circles
6 has 1 circle
7 has no circles
8 has 2 circles
9 has 1 circle

so

0000 = 1+1+1+1 = 4
8888 = 2+2+2+2 = 8