INPUT
Fetch from url
Upload file
Paste from clipboard
Load example file
normal example or STREAM_IMAGE example
OUTPUT
Download lua file
download
Permalink
Filename: .lua (used for random seed)
- COLLATZ CONJECTURE -
> READ NUMBER N FROM IN.N > IF N EVEN: STEP TO N / 2 > IF N ODD: STEP TO 3 * N + 1 > REPEAT STEPS UNTIL N = 1 > WRITE NUMBER OF STEPS TO REACH 1 > (INTERMEDIATE N STAY BELOW 1000)
IN.N
OUT.STEPS
IN.N
800 105 996 58 45 344 546 420 600 524 712 229 32 358 131 652 696 196 844 213 106 368 480 87 15 98 652 394 406 474 44 21 119 96 237 40 456 130 101
OUT.STEPS
28 38 49 19 16 32 30 40 17 30 33 34 5 32 28 25 33 26 41 13 12 19 22 30 17 25 25 27 40 35 16 7 33 12 34 8 35 28 25
IN.N
OUT.STEPS
IN.N
163 81 896 102 768 162 512 321 628 158 650 280 368 528 404 960 372 652 372 264 37 618 560 246 157 912 132 952 812 144 309 64 104 10 174 168 404 23 244
OUT.STEPS
23 22 23 25 15 23 9 24 38 36 25 16 19 30 27 23 19 25 19 29 21 25 17 47 36 36 28 36 41 23 24 6 12 6 31 10 27 15 21
IN.N
OUT.STEPS
IN.N
596 61 768 157 420 38 468 262 672 852 618 346 85 736 18 39 204 132 163 309 848 8 650 544 394 406 490 130 67 820 20 114 88 528 117 348 358 618 488
OUT.STEPS
25 19 15 36 40 21 22 29 12 15 25 32 9 20 20 34 26 28 23 24 15 3 25 17 27 40 22 28 27 28 7 33 17 30 20 32 32 25 22
IN.N
OUT.STEPS
IN.N
106 40 652 213 234 640 422 202 716 277 578 434 540 8 202 92 85 498 28 370 552 84 792 21 952 181 74 326 197 270 268 172 76 272 68 716 321 320 976
OUT.STEPS
12 8 25 13 21 12 40 26 33 16 30 27 43 3 26 17 9 48 18 45 17 9 28 7 36 18 22 24 26 42 29 31 22 16 14 33 24 11 23
Test run: [1] [2] [3] [4]