Fusc sequence: Difference between revisions
Content deleted Content added
Line 993:
const N_FIRST=61;
const MAX_N_DIGITS=6;
foreach( n; 0..N_FIRST ) ▼
format!"First %d fusc numbers: "(N_FIRST).write;
writeln; ▼
▲ foreach( n; 0..N_FIRST ) n.fusc.format!"%d ".write;
for(int n=0, ndigits=0; ndigits<MAX_N_DIGITS; n++)▼
format!"First fusc number for each number of digits (1 to %d digits):"(MAX_N_DIGITS).writeln;
if( n.fusc.to!string.length > ndigits ){
format!"fusc(%d
ndigits = n.fusc.to!string.length.to!int;
}
}</lang>
{{out}}
<pre>First 61 fusc numbers: 0 1 1 2 1 3 2 3 1 4 3 5 2 5 3 4 1 5 4 7 3 8 5 7 2 7 5 8 3 7 4 5 1 6 5 9 4 11 7 10 3 11 8 13 5 12 7 9 2 9 7 12 5 13 8 11 3 10 7 11 4
First fusc number for each number of digits (1 to 6 digits):
fusc(0)=0
fusc(37)=11
fusc(1173
fusc(35499
fusc(699051
fusc(19573419
=={{header|Delphi}}==
|