limit
, produces the longest chain?
NOTE: Once the chain starts the terms are allowed to go above one million.
longestCollatzSequence(14)
should return 9.
testString: assert.strictEqual(longestCollatzSequence(14), 9, 'longestCollatzSequence(14)
should return 9.');
- text: longestCollatzSequence(5847)
should return 3711.
testString: assert.strictEqual(longestCollatzSequence(5847), 3711, 'longestCollatzSequence(5847)
should return 3711.');
- text: longestCollatzSequence(46500)
should return 35655.
testString: assert.strictEqual(longestCollatzSequence(46500), 35655, 'longestCollatzSequence(46500)
should return 35655.');
- text: longestCollatzSequence(54512)
should return 52527.
testString: assert.strictEqual(longestCollatzSequence(54512), 52527, 'longestCollatzSequence(54512)
should return 52527.');
- text: longestCollatzSequence(1000000)
should return 837799.
testString: assert.strictEqual(longestCollatzSequence(1000000), 837799, 'longestCollatzSequence(1000000)
should return 837799.');
```