Last updated
Was this helpful?
Last updated
Was this helpful?
In Raku, arrays are indexed from 0. The Calkin-Wilf sequence does not have a term defined at 0.
This implementation includes a bogus undefined value at position 0, having the bogus first term shifts the indices up by one, making the ordinal position and index match. Useful due to how reversibility function works.