3 ms·
The notion of program optimization here is rather odd, as programs can refer to other programs in a single instruction. For example, the program for the prime n
by tromp 5y ago
The notion of program optimization here is rather odd, as programs can refer to other programs in a single instruction. For example, the program for the prime numbers is
seq $0,6005 ; The odd prime numbers together with 1.
max $0,2
and if we go down the rabbit hole, we find that the program for A006005 uses the instruction
seq $0,98090 ; Numbers k such that 2k-3 is prime.
where the A098090 program in turn uses
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
and this pattern continues with 4 programs containing instructions
seq $1,80339 ; Characteristic function of {1} union {primes}: 1 if n is 1 or a prime, else 0.
seq $0,38548 ; Number of divisors of n that are at most sqrt(n).
seq $0,94820 ; Partial sums of A038548.
seq $1,94820 ; Partial sums of A038548.
seq $0,132106 ; a(n) = 1 + floor(sqrt(n)) + Sum_{i=1..n} floor(n/i).
Where at last the program for A132106 doesn't use the seq instruction.
There also seems to be a danger here of creating cyclic definitions.
- ckrause 5y agoThere interpreter does not allow cyclic dependencies and the miner won't generate any. There is a difference between "optimization" (static code analysis) and "minimization" (brute-force removal of operations as long as the result is the same).