An easy puzzle for beginners:

You are in front of a computer which, upon your input, will produce a sequence of numbers. Your task is to discover which logic was used to program the computer.

Sitting in front of the computer, you type: 7. The computer replies with the sequence: 5, 4, 4, 4, and then 4 all along.

Then you type 6. The computer replies with: 3, 5, 4, 4, 4, and then 4 all along.

Pensive, you type 42. Computer's reply: 8, 5, 4, 4, 4, and then 4 all along again.

You try different numbers, and notice that all sequences eventually go with 4 repeated endlessly.

What is the algorithm used?


1 Answer 1


Each sequence is generated by:

Taking the number of letters in the spelling of the last number


7=S-E-V-E-N has 5 letters
5=F-I-V-E has 4 letters
4=F-O-U-R has 4 letters....

Also Note

Four is the only number that has the same number of letters as the number itself.

  • 2
    $\begingroup$ You were so quick in answering. Kudos, and yes, there's a sierpinski triangle there :-) $\endgroup$
    – ABcDexter
    Oct 11, 2015 at 19:27
  • $\begingroup$ You beat me to it. $\endgroup$
    – Sam Weaver
    Oct 12, 2015 at 10:51
  • 1
    $\begingroup$ I just happened to log on right after this question was posted. It's pretty rare for me to get first on one like this. $\endgroup$ Oct 12, 2015 at 16:43

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.