Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Ulam / Hailstone / Collatz (3n+1) sequence #866
True, especially because this hack only works for this special kind of sequence where the two parts of the definition correspond to odd and even numbers which can be simulated via the rem(p,q) function. However, generic multi-part-definitions with arbitrary conditions won't always be possible by means of such a hack.
You can program this sequence in Python. I did it for a slightly simpler variant : https://workshop.numworks.com/python/alain-busser/collatz