For historical interest, the original hacky, ungolfedThis computed F(5000) -- an 18, warning592-free version:digit number -- in under 10 seconds.
#include<stdio.h>
// In the golfed version, C is [58] to avoid subtracting z
int C[10]={1},n=1,z='0';
int main(int c,char**v){
FILE*f=popen("bc","w");
// This could have been char*p=strchr(*++v,0); but
// that would require another include.
char*p=*++v;while(*p)++p;
// *v always points to the beginning of the number with
// leading 0s removed. So when the last leading zero
// is gone, we're done. Before we start, we skip over all
// leading zeros (including the only 0 if that's the argument).
// This line is not in the golfed version.
while(**v==z)++*v;
while(**v){
// In the golfed version, the condition is *--p==z&&p!=*v
// to avoid a problem if the argument was 0. But that's not
// necessary here, because leading zeros have$ beentime eliminated.
// This subtracts one from the decimal representation of the number.
cg70892g3<<<5000|BC_LINE_LENGTH=0 bc|wc while(*--p==z)*p+=9;--*p;
// If the first digit of the number is now 0, move over it.
if(**v<=z)++*v;
// Now, we just count each digit, emitting the appropriatec
// multiply and divide.18593
for(p=*v;*p;fprintf(f,"%d/%d*",++n,++C[*p++-z]));
// At the end of the above, p is againreal pointing to the trailing NUL0m9.
}
// The formula (if one was produced) ends with a '*', so we
// need to fill in an identity, and add the return to trigger274s
user // the computation0m9.
fputs("1\n",f);
// This line is absolutely required for conformant execution; without
// it, the 'bc' processed is orphaned before it finishes and the output273s
// willsys be intermingled with the next command0m0.
return fclose(f);
}005s