I've noticed that when you enter a number with leading zeros, the result is as follows:
(ex) input: 002413
The maximal length is 2
Sequence starts at 2
Sequence is 13
i.e the function starts counting from 2. this is because int() chops off any leading zeros in a string.