Nп/п : 13 из 100
 От   : Ben Bacarisse                       2:5075/128        18 сен 23 12:31:10
 К    : Paul Rubin                                            18 сен 23 14:34:04
 Тема : Re: project euler 29
----------------------------------------------------------------------------------
                                                                                 
@MSGID: <87wmwnk9a9.fsf@bsb.me.uk> f325f193
@REPLY: <87v8c8oyby.fsf@nightsong.com> a40ba409
@REPLYADDR Ben Bacarisse <ben.usenet@bsb.me.uk>
@REPLYTO 2:5075/128 Ben Bacarisse
@CHRS: CP866 2
@RFC: 1 0
@RFC-Message-ID: <87wmwnk9a9.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> <87zg1kpcjh.fsf@nightsong.com><8734zcl4j0.fsf@bsb.me.uk>
<87v8c8oyby.fsf@nightsong.com>
@TZUTC: 0100
@PID: Gnus/5.13 (Gnus v5.13) Emacs/28.2
(gnu/linux)
@TID: FIDOGATE-5.12-ge4e8b94
Paul Rubin <no.email@nospam.invalid> writes:

> Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>>> So you just loop through 1 <= a,b <= 100 and count only the a,b pairs
>>> where a is the smallest a for its equivalence class.
>> This is likely to be fast which is why I wanted to compile Francesc`s to
>> try it out.  Mind you, a naive a^b == c^d test gives pretty good
>> performance for the kind of range requested.
>
> 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.

-- 
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    
                                                                                
В этой области больше нет сообщений.

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