Humble numbers: Difference between revisions

→‎Direct Generation: oops, forgot the first 50
m (→‎Direct Generation: re-posted results with -optimize flag set, added cpu used)
(→‎Direct Generation: oops, forgot the first 50)
Line 429:
 
using System;
using System.Linq;
using System.Collections.Generic;
 
Line 463 ⟶ 464:
} while (true);
Console.WriteLine("{0,13:n0} Total", lc);
int firstAmt = 50;
Console.WriteLine("The first {0} humble numbers are: {1}", firstAmt, string.Join(" ",h.Take(firstAmt)));
}
}</lang>
Line 568 ⟶ 571:
99 1,944,540 42,073 ms 4,077
100 2,003,661 43,808 ms 4,222
51,428,827 Total</pre>
The first 50 humble numbers are: 1 2 3 4 5 6 7 8 9 10 12 14 15 16 18 20 21 24 25 27 28 30 32 35 36 40 42 45 48 49 50 54 56 60 63 64 70 72 75 80 81 84 90 96 98 100 105 108 112 120</pre>
UInt64s: (comment out "'''#define BI'''" at the top of the code)
<pre>Digits Count Time Mb used
Line 590 ⟶ 594:
18 12,759 7 ms 2
19 14,927 7 ms 2
80,987 Total</pre>
The first 50 humble numbers are: 1 2 3 4 5 6 7 8 9 10 12 14 15 16 18 20 21 24 25 27 28 30 32 35 36 40 42 45 48 49 50 54 56 60 63 64 70 72 75 80 81 84 90 96 98 100 105 108 112 120</pre>
 
=={{header|C++}}==