Write a program or function which, when run, outputs another program or function which is valid in the same language as the original program, and which itself will output another program or function that has the same properties. You must at one point end up back to your initial program or function.
Example
Suppose you write program A
. When run, it outputs program B
. When you run B
, it outputs program C
. When you run C
, it outputs program A
, thus completing the circle. A
, B
and C
are all valid in the same language and are all different by at least one character.
Scoring
Your score is calculated as <Number of bytes of the initial program>/<number of iterations to get back to the initial program>
For instance, with the programs A
, B
and C
in the previous example, the number of iterations is 3
(you have to run 3 times to get back to A
) and the number of bytes is the number of bytes of A
.
This incentivize both golfing your initial code, and having an initial program that leads to a longer chain.
The smallest score wins
bytes/sqrt(log(cyclelength))
, or evenbytes/log(log(cyclelength))
? \$\endgroup\$