Monday, 4 May 2015

mathematics - Determine the algorithm


So I was given this puzzle quite some time ago and just thought it would make a nice addition to this site:


Your task is to determine the method how the result is determined from the given number. A few example cases include:


177383 -> 2

267453 -> 2
111111 -> 0
636240 -> 4
367183 -> 3
247123 -> 1
369108 -> 5


To those, who hit a brick wall, here is a tip: This puzzle is easiest for young children and gets harder the older you get... Happy guessing ;)





Answer



The number is the number of "holes" in the written decimal representation of the number.


More specifically, each digit contributes this much to the total number:


0: 1
1: 0
2: 0
3: 0
4: 0 or 1, depending on how you draw them
5: 0
6: 1

7: 0
8: 2
9: 1

In your case above, 4 is drawn with a hole, so it contributes 1.


No comments:

Post a Comment

Understanding Stagnation point in pitot fluid

What is stagnation point in fluid mechanics. At the open end of the pitot tube the velocity of the fluid becomes zero.But that should result...