Definitions
Sorry, no definitions found. Check out and contribute to the discussion of this word!
Etymologies
Sorry, no etymologies found.
Support

Help support Wordnik (and make this page ad-free) by adopting the word collatz.
Examples
-
To connect, telnet to collatz. mcrcim.mcgill.edu 5757
The Big Dummies' Guide to the Internet Version 2.0 : Chapter 11: IRCs and MUDs 1994
-
So I've recoded it a bit using a cache dictionary to store all the intermediate values in it: cache = {1: 1} def collatz (n, res): nn = n while True: if n in cache: if nn!
Planet Python 2010
-
The straightforward recursive solution: def collatz (n): if n = = 1: return 1 if n % 2 = = 0: return 1 + collatz (n/2) else: return 1 + collatz (3*n + 1) very rapidly converges to ... an error:
Planet Python 2010
-
= 1 + collatz (n/2, cache) else: cache [n] = 1 + collatz (3*n + 1, cache)
Planet Python 2010
Comments
Log in or sign up to get involved in the conversation. It's quick and easy.