Nп/п : 15 из 100
 От   : Ben Bacarisse                       2:5075/128        18 сен 23 15:20:16
 К    : Francesc Rocher                                       18 сен 23 17:22:04
 Тема : Re: project euler 29
----------------------------------------------------------------------------------
                                                                                 
@MSGID: <87il87k1gf.fsf@bsb.me.uk> f202ff8d
@REPLY:
<7a98a430-a01d-41e7-80fe-bc2e1e1592d3n@googlegroups.com> a07d6e4d
@REPLYADDR Ben Bacarisse <ben.usenet@bsb.me.uk>
@REPLYTO 2:5075/128 Ben Bacarisse
@CHRS: CP866 2
@RFC: 1 0
@RFC-Message-ID: <87il87k1gf.fsf@bsb.me.uk>
<beaa0494-5783-4130-b96f-1a5271466678n@googlegroups.com><874jjvmoi9.fsf@bsb.me.u
k><a10a258f-8a3a-4017-bb30-8fe5629089ffn@googlegroups.com><87sf7dltq0.fsf@bsb.me
.uk><87jzsplr49.fsf@bsb.me.uk><715fe49a-47bc-46be-ae26-9ed89b38bcb5n@googlegroups.co
m><87ediwl7oq.fsf@bsb.me.uk><87v8c8oyby.fsf@nightsong.com><87wmwnk9a9.fsf@bsb.me.uk><7a98a430-a01d-41e7-80fe
-bc2e1e1592d3n@googlegroups.com>
@TZUTC: 0100
@PID: Gnus/5.13 (Gnus v5.13) Emacs/28.2
(gnu/linux)
@TID: FIDOGATE-5.12-ge4e8b94
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.
--- Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
 * Origin: A noiseless patient Spider (2:5075/128)
SEEN-BY: 5001/100 5005/49 5015/255 5019/40 5020/715
848 1042 4441 12000
SEEN-BY: 5030/49 1081 5058/104 5075/128
@PATH: 5075/128 5020/1042 4441



   GoldED+ VK   │                                                 │   09:55:30    
                                                                                
В этой области больше нет сообщений.

Остаться здесь
Перейти к списку сообщений
Перейти к списку эх