Ed Gottsman, mainly,

I was so annoyed with the 14+ minutes it took my solution for Euler Problem 778 to run that I revamped it to a cleaner,  but somewhat more complicated approach.  It was the same maths,  including finite/modular stuff but now avoiding the use or extended integers:  I
eventually got it to work.

So the new approach runs in ~1.25 seconds and probably uses less memory, though I haven't proved that assertion.  The disadvantage is of course that it took me several hours of error-
chasing to achieve the speed-up!

I can't find my solution to problem 51!   There was a time when I'd solved all of the extant problems.  But they got harder,  and I've slowed down,  and now have over 300 in my
unsolved list.

Cheers,

Mike

-------- Forwarded Message --------
Subject:        Re: [Jprogramming] Extended precision question
Date:   Mon, 2 May 2022 05:54:46 +0100
From:   Ed Gottsman <[email protected]>
Reply-To:       [email protected]
To:     [email protected]



Mike,

Many thanks for the guidance. I’d already determined that my x: approaches to #66 were going to involve waiting for the earth to crash into the sun—or, equally unattractive, paying Google Cloud Platform for a fleet of “Godzilla” class VMs—so I am looking in other directions. I took a break and went back to Prime Digit Replacements (#51), the brevity of whose eventual solution filled me with nerd pride :-). (Am I the only Project Euler J developer who gets a guilty thrill from reviewing the magnum opuses submitted by other participants?)

Thanks again.

Ed

Sent from my iPad

On May 1, 2022, at 8:25 PM, 'Michael Day' via Programming <[email protected]> wrote:

Mainly for Ed Gottsman:

Chat really, but the thread is already here.

I've just solved Euler Problem 788 with the assistance of extended precision numbers. The solution is slow, taking over 14 minutes, but at least it's less than the lifetime of the universe, unlike my (projected)
methods for some of these problems!

It's relatively easy, compared with many of the recent questions; https://projecteuler.net/problem=788 .

As for Ed's original post, I'll point out that x: features aren't necessary for the solution of problem 66 although they can possibly help in understanding it. I don't think that's a spoiler.

Cheers,

Mike

On 21/04/2022 17:43, Ed Gottsman wrote:
Hello.
I’m working on the Project Euler “Diophantine equation” problem (#66) and using J’s extended precision facilities. I’ve run into behavior that confuses me. Boiled down (and overusing x: just to be sure):
x: %: x: 1 + x: *: x: 999999999
999999999
That is (if my syntax is right), the square root of (one plus the square of a really large n) is n. I’m apparently misunderstanding something about extended precision. I’ve tried it with a variety of uses of x: but to no avail, and as I read the x: documentation…this is an odd result.

Any help would be much appreciated.
(J901 on iPadOS, for which sincere kudos to Ian Clark.)
Many thanks.
Ed
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm


-- This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to