Download Latest Version collatztool.zip (268.6 kB)
Email in envelope

Get an email when there's a new version of Collatz Tool

Home
Name Modified Size InfoDownloads / Week
README 2011-05-17 2.6 kB
collatztool.zip 2011-05-17 268.6 kB
Totals: 2 Items   271.1 kB 0
WHATS THIS:
Collatz Tool is a little console based program to generate collatz numbers. 
The basic collatz rule is
           
x_(n+1) =  { x_n/2, if x_n is even,
             factor*x_n+1, if x_n is odd. }

where factor is 3, but you can change the factor by the option -f.
You control the program by parameters on console as follows:

OPTIONS:
  -f factor             - collatz factor (3)
  -s startnumber        - number where to start (23)
  -m maxloops           - maximum of loops (10000)
  -o output             - output file for data ("output.csv")
                          (either Standard or Alternative Format)
  -n                    - no output, only test for termination (faster)
  -t numbers            - tests algorithm with iteration on startnumber
  -a                    - alternative output
  -h                    - this help text

If no options are given, it will create standard output of collatz numbers to "output.csv". 

HOW TO START:
WINDOWS XP:
To get this thing started press WindowsKey+R or go to startmenu and "Run...". 
Enter "cmd" into that little input window and now you get a black screen aka console ...

WINDOWS 7:
Go to Startmenu and type "cmd" right into this search field and "Enter" it. 
If you need admin rights, you will have to press "Ctrl+Shift+Enter" to start 
the console with admin rights ...


... navigate to the folder, e.g. "C:\Collatz" with the "cd" command:
"cd C:\Collatz". If you want to work on a different drive, then you will have to 
switch first by typing:
"D:"
and then navigate as explained above.

Now you have access to collatz.exe. Use parameters to control the output.
Example, with startnumber=7, factor=7, maxloops=1000, output=myoutput.csv

collatz.exe -s 7 -f 7 -m 1000 -o "myoutput.csv"
...


USED SOURCE LIBRARIES (you will need if you want to compile):
bigInt from sourceforge
http://sourceforge.net/projects/cpp-bigint/  
This Library provides arbitrary precision integers.


For analysis you can use matlab, R, gnuplot or whatever you like. 
Just import as csv file and take care of skipping the first line which is 
just a comment and use ";" as separator.
Be careful with importing too large numbers into other programs because most of them are not able to read these correctly.


So have a lot of fun!
wmatthias

Article (german)
http://11235813tdd.blogspot.com/2011/04/collatz-folge-mit-big-integers.html

Images visualizing collatz numbers
https://picasaweb.google.com/102560696045384678534/CollatzProblemBilder
Source: README, updated 2011-05-17