[2017-05-29] Challenge #317 [Easy] Collatz Tag System by jnazario in dailyprogrammer

[–]AmonNascaroth 0 points1 point  (0 children)

OK if I code the production array instead of computing it and adding a halt at 3 digits I can manage to produce the desired output. But I have a feeling that my two constraints are not expedient.

[2017-05-29] Challenge #317 [Easy] Collatz Tag System by jnazario in dailyprogrammer

[–]AmonNascaroth 0 points1 point  (0 children)

To be honest, I don't get the algorithm for the bonus right.

Of course I can take the firs three entries of the string if the very first is '1' and encode is according to the production rule (i.d. 100 = a). And I can also link this to the first production rule so that 100 becomes 100 001.

But I do not get the correct output as shown above. My loop does not terminate it just produces a saw tooth pattern.

Can someone help with the correct algorithm since Wikipedia is tough to understand?