Fractran: Difference between revisions
→Revised Results
(→Revised Code: Output of zero powers is replaced by spaces.) |
|||
Line 1,080:
17/91, 78/85, 19/51, 23/38, 29/33, 77/29, 95/23, 77/19, 1/17, 11/13, 13/11, 15/14, 15/2, 55/1
Start with N = 2, step limit 28
Require 10 primes only, up to Prime(10) = 29
N as powers of prime factors
Step F#: 2 3 5 7 11 13 17 19 23 29
0 : 1
1 13:
2 14:
3 5:
4 6:
5 11:
6 1:
7 2: 1 1 1
8 10: 1 1 1
9 5: 1
10 6: 1
11 11: 1
12 1: 1
13 2: 2 1
14 10: 2 1
15 5: 2
16 6: 2
17 11: 2
18 1: 2
19 9: 2
20 13: 1 1 1
21 13:
22 14:
23 5:
24 6:
25 5:
26 6:
27 11:
28 1:
</pre>
This time, restricting output to only occasions when N is a power of two requires no peculiar bit-counting function. Just change the interpretation loop to <lang Fortran> DO I = 1,
IT = FRACTRAN(
IF (ALL(NPPOW(2:LP).EQ.0))
▲ END DO !The next step. </lang>
Output:
Line 1,126 ⟶ 1,125:
17/91, 78/85, 19/51, 23/38, 29/33, 77/29, 95/23, 77/19, 1/17, 11/13, 13/11, 15/14, 15/2, 55/1
Start with N = 2, step limit 6666666
Require 10 primes only, up to Prime(10) = 29
N as powers of prime factors
Step F#: 2 3 5 7 11 13 17 19 23 29
0 : 1
19 9: 2
69 9: 3
280 9: 5
707 9: 7
2363 9: 11
3876 9: 13
8068 9: 17
11319 9: 19
19201 9: 23
36866 9: 29
45551 9: 31
75224 9: 37
101112 9: 41
117831 9: 43
152025 9: 47
215384 9: 53
293375 9: 59
327020 9: 61
428553 9: 67
507519 9: 71
555694 9: 73
700063 9: 79
808331 9: 83
989526 9: 89
1273490 9: 97
1434366 9: 101
1530213 9: 103
1710923 9: 107
1818254 9: 109
2019962 9: 113
2833089 9: 127
3104685 9: 131
3546320 9: 137
3720785 9: 139
4549718 9: 149
4755581 9: 151
5329874 9: 157
5958403 9: 163
6400897 9: 167
Execution took about two seconds.
|