From: Ben Bacarisse <ben.usenet@bsb.me.uk>
Subject: Re: project euler 29
Date: Mon, 18 Sep 2023 15:20:16 +0100 [thread overview]
Message-ID: <87il87k1gf.fsf@bsb.me.uk> (raw)
In-Reply-To: 7a98a430-a01d-41e7-80fe-bc2e1e1592d3n@googlegroups.com
Francesc Rocher <francesc.rocher@gmail.com> writes:
>> > But Francesc's program doesn't use that method. It only suggests it in
>> > a comment. The program actually works by building a list, sorting it,
>> > and counting the groups.
>
>> I only looked briefly and thought it used the factor method to decide if
>> the power is one that occurs earlier in the sequence. Two trivial
>> things, starting with Answer as the full NxN count and then decrementing
>> Answer made me think that was what it was doing.
>
> Exactly,
I thought so.
> Implementing the equality operator for a**b = x**y is also an
> alternative algorithm. Using it would require a loop for a in 2..99,
> b in 2..100, x in a+1..100 and y in 2..100. Is this correct? Or are
> there other constraints?
Well I just stored the unique pairs found so far. It's not very
efficient, but perfectly fast enough for a,b in [2, 100].
> If anyone is interested, for performance comparison or whatever reason, I can
> provide a stand alone version.
I am curious, but only if it's not too much work.
--
Ben.
next prev parent reply other threads:[~2023-09-18 14:20 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-15 9:03 project euler 29 CSYH (QAQ)
2023-09-15 9:50 ` Jeffrey R.Carter
2023-09-15 18:04 ` Keith Thompson
2023-09-15 15:42 ` Ben Bacarisse
2023-09-16 10:07 ` Francesc Rocher
2023-09-16 20:59 ` Ben Bacarisse
2023-09-16 21:56 ` Ben Bacarisse
2023-09-17 18:56 ` Francesc Rocher
2023-09-17 22:54 ` Paul Rubin
2023-09-17 23:08 ` Ben Bacarisse
2023-09-18 0:09 ` Paul Rubin
2023-09-18 0:16 ` Ben Bacarisse
2023-09-18 5:16 ` Paul Rubin
2023-09-18 11:31 ` Ben Bacarisse
2023-09-18 13:04 ` Francesc Rocher
2023-09-18 14:20 ` Ben Bacarisse [this message]
2023-09-18 16:55 ` Francesc Rocher
2023-09-18 19:22 ` Ben Bacarisse
2023-09-18 19:38 ` Paul Rubin
2023-09-18 19:52 ` comp.lang.ada
2023-09-18 19:56 ` comp.lang.ada
2023-09-18 20:01 ` Ben Bacarisse
2023-09-15 16:34 ` Jeffrey R.Carter
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox