From: "Joost Diepenmaat" <joost / zeekat.nl>
>
> On Sun, Jul 17, 2005 at 05:23:09AM +0900, Joost Diepenmaat wrote:
> > On Sun, Jul 17, 2005 at 05:01:02AM +0900, Bill Kelly wrote:
> > > From: "Olaf Klischat" <klischat / cs.tu-berlin.de>
> > > >
> > > > See? One number per 200-numbers interval. Every time[1]. This hints at
> > > > a wrong implementation.
> > > 
> > > I used the same approach.  I wasn't sure if it was legal
> > > or not.  But it was sure easy... :)
> > 
> > I'm sure it was :-)
> > 
> > I'm now down to 1.24 seconds without "cheating":
> 
> erm, make that 1 MINUTE 24 seconds. I'm not *that* good :-)

I *think* I've got a non-cheating one (I'll leave that to
y'all to decide later) that runs in:

$ time ruby sample-c.rb 5_000_000 1_000_000_000 > big_sample-c.txt
real    0m55.169s
user    0m53.860s
sys     0m1.210s

on the 2.4GHz Celeron system.


$ wc big_sample-c.txt
 5000000  5000000 49445562 big_sample-c.txt

$ head big_sample-c.txt
13
41
870
1225
1281
1434
1649
1921
1991
3047

$ tail big_sample-c.txt
999997887
999998139
999998335
999998632
999998893
999998947
999999169
999999219
999999271
999999587


Regards,

Bill