From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Ben Bacarisse Newsgroups: comp.lang.ada Subject: Re: project euler 29 Date: Sat, 16 Sep 2023 22:56:06 +0100 Organization: A noiseless patient Spider Message-ID: <87jzsplr49.fsf@bsb.me.uk> References: <874jjvmoi9.fsf@bsb.me.uk> <87sf7dltq0.fsf@bsb.me.uk> MIME-Version: 1.0 Content-Type: text/plain Injection-Info: dont-email.me; posting-host="b7cd21ae8fc8adc867bcadd01f23c303"; logging-data="26237"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1849B2ld/A16Lyvd1MR5CAMGN7Zg6suzxE=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Cancel-Lock: sha1:A8D5bKcfdJLxt0a5miOMlouaikk= sha1:mMpJKDcb+0+Lz4q7FIRce+aAVEU= X-BSB-Auth: 1.99b865d81c3d3a5a87ca.20230916225606BST.87jzsplr49.fsf@bsb.me.uk Xref: news.eternal-september.org comp.lang.ada:65665 List-Id: Ben Bacarisse writes: > Francesc Rocher writes: > >> El dia divendres, 15 de setembre de 2023 a les 17:42:43 UTC+2, Ben Bacarisse va escriure: >>> "CSYH (QAQ)" writes: >>> >>> > Now this time, I am facing trouble for problem #29. As I know integer >>> > type is for 32 bits. but for this problem as me to find out the 2 ** >>> > 100 and even 100 ** 100. I used python to get the answer correctly in >>> > 5 minutes. >> >>> Most of the Project Euler problems have solutions that are not always >>> the obvious one (though sometimes the obvious one is the best). You >>> can, of course, just use a big number type (or write your own!) but this >>> problem can be solved without having to use any large numbers at all. >> >> Please take a look at this solution: >> https://github.com/rocher/alice-project_euler-rocher/blob/main/src/0001-0100/p0029_distinct_powers.adb > > Why? That came over as rather curt. I meant what is it about the code that you are drawing my attention to -- its particular use of Ada, its structure, the algorithm, the performance...? What (and where) is Euler_Tools? -- Ben.