(phixonline)[nb very slow]-->
constant limit = 20_000_000
sequence fuscs = repeat(0,limit); -- NB 1-based indexing; fusc(0)===fuscs[1]
fuscs[2] = 1 -- ie fusc(1):=1
for n=3 to limit do
fuscs[n] = iff(remainder(n-1,2)?fuscs[n/2]+fuscs[n/2+1]:fuscs[(n+1)/2])
end for
--printf(1,"First 61 terms of the Fusc sequence:\n%v\n",{fuscs[1..61]})
string s = ""
for n=1 to 61 do s&=sprintf("%,d ",fuscs[n]) end for
printf(1,"First 61 terms of the Fusc sequence:\n%s\n\n",{s})
printf(1,"Elements with more digits than any previous items:\n")
printf(1," Index : Value\n")
integer d = 0
for n=1 to length(fuscs) do
if fuscs[n]>=d then
printf(1,"%,15d : %,d\n",{n-1,fuscs[n]})
d = iff(d=0?10:d*10)
end if
end for