Skip to content
/ collatz Public

Collatz conjecture computation with snazzy rendering.

License

Notifications You must be signed in to change notification settings

Olical/collatz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

collatz

The Collatz conjecture in Clojure as a lazy sequence. Also includes a neat visualisation inspired by this awesome video, you can run the visualisation with lein run.

Nothing will render until you hit the Enter key, and even then it may take a little while, it's fairly CPU intensive.

Visualisation is still completely wrong right now, it still looks kind of neat, but it's not the final product.

You'll find the actual Collatz sequence function in the collatz.core namespace.

(ns cool.thing
  (:require [collatz.core :as c]))

(first (c/collatz 1000)) ;; Returns 1000, the seq starts where you specify and counts down.
(last (c/collatz 1000)) ;; Returns 1, as it always will be, I assume?

If the last value is ever not 1, notify your closest mathematician and run.

About

Collatz conjecture computation with snazzy rendering.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published