Collatz Tool Code
Status: Beta
Brought to you by:
wmatthias
File | Date | Author | Commit |
---|---|---|---|
Makefile.Linux | 2011-05-17 | wmatthias | [r1] initial commit at version 0.5 |
Makefile.Windows | 2011-05-17 | wmatthias | [r1] initial commit at version 0.5 |
README.txt | 2011-05-17 | wmatthias | [r1] initial commit at version 0.5 |
main.cpp | 2011-05-17 | wmatthias | [r1] initial commit at version 0.5 |
Collatz Tool README @License GPL v2.1 @author Matthias Werner <wmatthias at users.sourceforge.net> @date 17. 05. 2011 ============================================================= 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" ... LINUX: Download the source from: https://sourceforge.net/projects/collatztool and use the makefile Makefile.Linux to compile. USED SOURCE LIBRARIES: bigInt from sourceforge http://sourceforge.net/projects/cpp-bigint/ This Library provides arbitrary precision integers. LICENSE: GPL v2 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