Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Dr J R Stockton Newsgroups: comp.lang.javascript Subject: Re: Primality sieve challenge Date: Thu, 21 Jan 2016 23:20:38 +0000 Organization: Home Lines: 27 Message-ID: References: <5b608a56-e16b-4467-a0ce-4e30f6796920@googlegroups.com> <871t9gfa2z.fsf@bsb.me.uk> <8b01caa9-8c09-4e69-915b-81b67eba7edc@googlegroups.com> <0b16c016-5128-4b68-8046-fbec55700ec3@googlegroups.com> <60329a65-27f8-483e-bd6e-e262e952ee6f@googlegroups.com> <871t9fd6p7.fsf@bsb.me.uk> <57bd7c90-81fd-4fe9-b329-1d58db4ff3f1@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: mx02.eternal-september.org; posting-host="01da9e6251d9b3ee47bb70bebae42d53"; logging-data="19514"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/B/0uHm9X6/D71yR6TQclcFcsxRhOXRyo=" User-Agent: Turnpike/6.05-S () Cancel-Lock: sha1:AiDfQ0ASoj2CJG7KrA8xb79zomo= Xref: csiph.com comp.lang.javascript:29399 In comp.lang.javascript message , Tue, 19 Jan 2016 02:42:13, Stefan Weiss posted: > >A common estimate for the number of atoms in the observable universe is >10^80. That's a number with ~80 digits. You're going for a number with >17425170 digits. The raw decimal number takes ~17MB to store in an >uncompressed ASCII file, like you're proposing. If you were to print it >out, you'd need around 4k-5k sheets of paper (pages). That shows the importance of optimising the base. One would only need about 5/6 as many digits in ordinary Hex. In binary, one would need 3.3 times as many digits; but each digit could be compressed on the paper to a single black or white pixel, and one could do even better with coloured pixels. I estimate that a really good inkjet printer might get the whole lot onto a single sheet of paper. Via the Wayback Machine, http://www.merlyn.demon.co.uk/js-misc0.htm has JavaScript code for Sieves of Eratosthenes. -- (c) John Stockton, Surrey, UK. ¬@merlyn.demon.co.uk Turnpike v6.05 MIME. Merlyn Web Site < > - FAQish topics, acronyms, & links.