12-Jun-2022 20:57:50 collatz_test(): MATLAB/Octave version 4.2.2. Test collatz(). collatz_test01() collatz() computes the Collatz sequence for a given key. key: 5 Sequence length: 6 5 16 8 4 2 1 key: 6 Sequence length: 9 6 3 10 5 16 8 4 2 1 key: 19 Sequence length: 21 19 58 29 88 44 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 1 key: 27 Sequence length: 112 27 82 41 124 62 31 94 47 142 71 214 107 322 161 484 242 121 364 182 91 274 137 412 206 103 310 155 466 233 700 350 175 526 263 790 395 1186 593 1780 890 445 1336 668 334 167 502 251 754 377 1132 566 283 850 425 1276 638 319 958 479 1438 719 2158 1079 3238 1619 4858 2429 7288 3644 1822 911 2734 1367 4102 2051 6154 3077 9232 4616 2308 1154 577 1732 866 433 1300 650 325 976 488 244 122 61 184 92 46 23 70 35 106 53 160 80 40 20 10 5 16 8 4 2 1 key: 95 Sequence length: 106 95 286 143 430 215 646 323 970 485 1456 728 364 182 91 274 137 412 206 103 310 155 466 233 700 350 175 526 263 790 395 1186 593 1780 890 445 1336 668 334 167 502 251 754 377 1132 566 283 850 425 1276 638 319 958 479 1438 719 2158 1079 3238 1619 4858 2429 7288 3644 1822 911 2734 1367 4102 2051 6154 3077 9232 4616 2308 1154 577 1732 866 433 1300 650 325 976 488 244 122 61 184 92 46 23 70 35 106 53 160 80 40 20 10 5 16 8 4 2 1 collatz_test02(): collatz_count() computes the length of the Collatz sequence for a given key. 1 1 2 2 3 8 4 3 5 6 6 9 7 17 8 4 9 20 10 7 11 15 12 10 13 10 14 18 15 18 16 5 17 13 18 21 19 21 20 8 21 8 22 16 23 16 24 11 25 24 26 11 27 112 28 19 29 19 30 19 31 107 32 6 33 27 34 14 35 14 36 22 37 22 38 22 39 35 40 9 41 110 42 9 43 30 44 17 45 17 46 17 47 105 48 12 49 25 50 25 51 25 52 12 53 12 54 113 55 113 56 20 57 33 58 20 59 33 60 20 61 20 62 108 63 108 64 7 65 28 66 28 67 28 68 15 69 15 70 15 71 103 72 23 73 116 74 23 75 15 76 23 77 23 78 36 79 36 80 10 81 23 82 111 83 111 84 10 85 10 86 31 87 31 88 18 89 31 90 18 91 93 92 18 93 18 94 106 95 106 96 13 97 119 98 26 99 26 100 26 collatz_test03(): collatz_write() writes a Collatz sequence to a file. Write the Collatz sequence with key 27 to "collatz_27.txt". Write the Collatz count sequence from 1 to 100 to "collatz_count.txt". collatz_test04(): Plot the points of a Collatz sequence. Graphics saved as "collatz_sequence_27.png". collatz_test05(): Plot the Collatz max for starting values 1 to 100. Graphics saved as "collatz_max.png". collatz_test06(): Plot the Collatz count for starting values 1 to 100. Graphics saved as "collatz_count.png". mollatz_test01() mollatz() computes the mollatz sequence for a given key. s = 5 14 s = 5 14 7 s = 5 14 7 20 s = 5 14 7 20 10 s = 5 14 7 20 10 5 key: 5 Sequence length: 6 5 14 7 20 10 5 s = 6 3 s = 6 3 8 s = 6 3 8 4 s = 6 3 8 4 2 s = 6 3 8 4 2 1 s = 6 3 8 4 2 1 2 key: 6 Sequence length: 7 6 3 8 4 2 1 2 s = 19 56 s = 19 56 28 s = 19 56 28 14 s = 19 56 28 14 7 s = 19 56 28 14 7 20 s = 19 56 28 14 7 20 10 s = 19 56 28 14 7 20 10 5 s = 19 56 28 14 7 20 10 5 14 key: 19 Sequence length: 9 19 56 28 14 7 20 10 5 14 s = 27 80 s = 27 80 40 s = 27 80 40 20 s = 27 80 40 20 10 s = 27 80 40 20 10 5 s = 27 80 40 20 10 5 14 s = 27 80 40 20 10 5 14 7 s = 27 80 40 20 10 5 14 7 20 key: 27 Sequence length: 9 27 80 40 20 10 5 14 7 20 s = 95 284 s = 95 284 142 s = 95 284 142 71 s = 95 284 142 71 212 s = 95 284 142 71 212 106 s = 95 284 142 71 212 106 53 s = 95 284 142 71 212 106 53 158 s = 95 284 142 71 212 106 53 158 79 s = 95 284 142 71 212 106 53 158 79 236 s = 95 284 142 71 212 106 53 158 79 236 118 s = 95 284 142 71 212 106 53 158 79 236 118 59 s = 95 284 142 71 212 106 53 158 79 236 118 59 176 s = Columns 1 through 13: 95 284 142 71 212 106 53 158 79 236 118 59 176 Column 14: 88 s = Columns 1 through 13: 95 284 142 71 212 106 53 158 79 236 118 59 176 Columns 14 and 15: 88 44 s = Columns 1 through 13: 95 284 142 71 212 106 53 158 79 236 118 59 176 Columns 14 through 16: 88 44 22 s = Columns 1 through 13: 95 284 142 71 212 106 53 158 79 236 118 59 176 Columns 14 through 17: 88 44 22 11 s = Columns 1 through 13: 95 284 142 71 212 106 53 158 79 236 118 59 176 Columns 14 through 18: 88 44 22 11 32 s = Columns 1 through 13: 95 284 142 71 212 106 53 158 79 236 118 59 176 Columns 14 through 19: 88 44 22 11 32 16 s = Columns 1 through 13: 95 284 142 71 212 106 53 158 79 236 118 59 176 Columns 14 through 20: 88 44 22 11 32 16 8 s = Columns 1 through 13: 95 284 142 71 212 106 53 158 79 236 118 59 176 Columns 14 through 21: 88 44 22 11 32 16 8 4 s = Columns 1 through 13: 95 284 142 71 212 106 53 158 79 236 118 59 176 Columns 14 through 22: 88 44 22 11 32 16 8 4 2 s = Columns 1 through 13: 95 284 142 71 212 106 53 158 79 236 118 59 176 Columns 14 through 23: 88 44 22 11 32 16 8 4 2 1 s = Columns 1 through 13: 95 284 142 71 212 106 53 158 79 236 118 59 176 Columns 14 through 24: 88 44 22 11 32 16 8 4 2 1 2 key: 95 Sequence length: 24 95 284 142 71 212 106 53 158 79 236 118 59 176 88 44 22 11 32 16 8 4 2 1 2 nollatz_test01() nollatz() computes the Nollatz sequence for a given key. key: 5 Sequence length: 6 5 6 3 4 2 1 key: 6 Sequence length: 5 6 3 4 2 1 key: 19 Sequence length: 9 19 20 10 5 6 3 4 2 1 key: 27 Sequence length: 8 27 28 14 7 8 4 2 1 key: 95 Sequence length: 10 95 96 48 24 12 6 3 4 2 1 collatz_test(): Normal end of execution. 12-Jun-2022 20:57:53