6
$\begingroup$

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?

$\endgroup$
11
$\begingroup$

Each sequence is generated by:

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

I.E.

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.

$\endgroup$
  • 2
    $\begingroup$ You were so quick in answering. Kudos, and yes, there's a sierpinski triangle there :-) $\endgroup$ – ABcDexter Oct 11 '15 at 19:27
  • $\begingroup$ You beat me to it. $\endgroup$ – Sam Weaver Oct 12 '15 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$ – Spencerkatty Oct 12 '15 at 16:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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