Only just up - having breakfast! I evidently solved it, as the
project's discussion thread
is open to me, but I don't have a record of my method.
Early-ish PE problems were amenable to brute force, and I expect that's
how I would have
done it.
AFAIrecall, later problems involving phi require insight how phi is
calculated:
if n = */p^q, phi(n) = */(p^(q-1)) * p-1
eg
q:360
2 2 2 3 3 5
p =: 2 3 5
q =: 3 2 1
*/(p^q-1) * p-1
96
5 p: 360
96
so n/phi(n) is
*/@:(%<:) p
3.75
No time for more - away from wifi for 10 hours or so!
Mike
On 15/03/2017 03:09, Don Guinn wrote:
My second approach was brute force like you did. It gave the same number as
my first approach. And interestingly it was faster than my first approach.
Happens sometimes. The only thing I can think of is that I found the answer
but I didn't supply what they wanted. I supplied the first number that had
as a permutation of the digits given sorted by (%totient)n . I cheated.
Stole totient from J phrases.
The only thing I can think of is that they wanted something other than the
n that I found.
On Tue, Mar 14, 2017 at 8:12 PM, 'Jon Hough' via Programming <
programm...@jsoftware.com> wrote:
I just tried it and got the right answer. But my approach is essentially
brute force:
I basically stringified (":) the totient result, sorted it, and compared
to the sorted stringified original number.
I can be more specific if you like.
Regards,
Jon
--------------------------------------------
On Wed, 3/15/17, Don Guinn <dongu...@gmail.com> wrote:
Subject: [Jprogramming] Project Euler
To: "Programming forum" <programm...@jsoftware.com>
Date: Wednesday, March 15, 2017, 9:37 AM
Has anyone out there solved problem
70? I have worked it two ways which
give the same answer but it is given as incorrect. I don't
want to divulge
what I did as that is against their rules. I must be missing
something and
presenting the wrong number for the result. Or is it
possible that their
answer is wrong?
Glad to discuss it in the forum, but if anyone wants to
contact me
privately so we don't break Project Euler rules, contact me
at
dongu...@gmail.com
Thanks.
----------------------------------------------------------------------
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
---
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