# Oh no! Yet another number series... - Find the pattern in the two examples and provide an extension

Because these have been so successful in the past, I had to bring up my own. In fact, this puzzle was inspired by Find the next number even though I (and I guess everybody but the author) still don't know the intended solution yet. Anyway, here it is:

## The puzzle

The British inventor Jackemias Muff invented (and build) a number-evolving machine in 1817. (It was a cold, windy winter's day in Manchester, the Sunday before boxing-day.) You could feed it with any number, and it would produce an unambiguously determined, endless series of follow-up numbers.

For example, if you feed it with "8" you would get

8,5,10,14,23,36,47,59,70,78,84,96,...

If you feed it with "28" instead, you would get

28,12,19,28,41,51,61,71,83,96,...

Can you explain how his machine works and build a copy?

Victory condition: A correct answer is able to reproduce both series starting from the same seed values and can successfully predict the next number in each series.

I do not have proof that Muff's machine is unique, although I believe it is.

I will add hints over time, one is given as a starter:

In 1817, computers have not yet been invented. (Well, 'computer' was still a job-description those days..)

• Just going for the victory condition: var input = window.prompt('Feed me'); var output = []; output[8] = '8,5,10,14,23,36,47,59,70,78,84,96,'; output[28] = '28,12,19,28,41,51,61,71,83,96,'; while (true) console.log( output[ input ] ); :-)
– Joe
Commented Nov 27, 2014 at 14:14
• @Joe So you predict that the next numbers are...? Commented Nov 27, 2014 at 14:15
• @No.7892142 the number you input. It just loops. Before anyone gets upset, there's a reason it's a comment and not an answer ;-)
– Joe
Commented Nov 27, 2014 at 14:15
• +1 for not just skipping any number-series puzzle. ;-) (But wrong answer ;->) Commented Nov 27, 2014 at 14:16
• @skv: :c) Pretty, actually. But I will accept any valid solution and I would LOVE to see one which isn't mine. Commented Nov 27, 2014 at 14:24

The sequence is generated as follows:

Each consecutive term is except for the first (5 and 12 respectively) term is made by adding 1 and the length of the text representation of the current number to the current number. The 5 and 12 are made by simply counting the length of the text representation of the first term.

Thus

Next terms will be 107

First sequence:

8 -> "eight" -> 5
5 -> 5 + len("five") + 1 -> 10
10 + len("ten") + 1 -> 14
14 + len("fourteen") + 1 -> 23
Next steps are obvious.

• I knew it would be too easy :c) Commented Nov 27, 2014 at 14:57
• Nicely spotted! Commented Nov 27, 2014 at 15:00
• @BmyGuest It was one of those which you either solve on the spot or you don't at all. Nice one though :)
– dmg
Commented Nov 27, 2014 at 15:04
• a machine that counts keys, computes adding by 1 and shows the result with other keys representing digits... in 1817... ok Commented Nov 27, 2014 at 18:49
• @kokbira as with most machines from that time: when you opened the cupboard underneath you'd have found an Indian dwarf with a big brain and a fast handwriting.... Commented Nov 27, 2014 at 19:07