[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

I wrote a 3+1 guile program, feedback welcome

From: Joshua Branson
Subject: I wrote a 3+1 guile program, feedback welcome
Date: Wed, 07 Nov 2018 10:14:06 -0500


I spent a week or two working on the 3+1 problem.  The 3+1 problem is a
fun number theory conjecture.  It states that there exists a procedure
for turning all positive whole integers into 1.  The procedure is:

If the number is even, then divide it by two.
If the number is odd, multiply by 3 and add 1.

I decided to write a program to graph the number of iterations it takes
for the set of numbers 2-n to reach 1.  It uses ice-9 getopt-long, so
the usual --help and --version work.  It uses gnuplot, because I
couldn't get guile-charting to work.  If anyone has enough free time to
comment on the state of this program, or any tips about how to make it
better, etc. that would be most helpful.



Attachment: collatz.scm
Description: collatz.scm

reply via email to

[Prev in Thread] Current Thread [Next in Thread]