Re: [Jprogramming] Project Euler

2017-03-15 Thread Don Guinn
One nice thing about 5 p: over totient is that it returns integer instead of float. 3!:0 totient 10 8 (3!:0) 5 p: 10 4 On Wed, Mar 15, 2017 at 10:25 AM, 'Mike Day' via Programming < [email protected]> wrote: > Had a new look at the problem. Reworked verbs as I'd not kept the > old

Re: [Jprogramming] Moving median - any good methods?

2017-03-15 Thread 'Mike Day' via Programming
Thanks .to Jon Hough for the link to priority queues. I had a look. I doubt they're directly relevant as a moving median needs to be able to remove a particular element rather than that chosen by the remove method used there - if I understand it right. However, it does show how to set up a

Re: [Jprogramming] Project Euler

2017-03-15 Thread 'Mike Day' via Programming
Had a new look at the problem. Reworked verbs as I'd not kept the old. First pass, pretty brutal, took ~100 sec, in j806beta with avx. Later efforts to speed it up were worse! Evidently better to compare sorted character reps of numbers than sorted base 10 decodes. M Please reply to mike

Re: [Jprogramming] Project Euler

2017-03-15 Thread Don Guinn
Wow! Missed 5 p: . Maybe time to read through the vocabulary again. On Tue, Mar 14, 2017 at 9:41 PM, chris burke wrote: > > Also, I stole totient from J phrases too. > > You can also steal it from the vocabulary, e.g. > >5 p: 12 > 4 > > On Tue, Mar 14, 2017 at 8:24 PM, 'Jon Hough' via Progra

Re: [Jprogramming] Project Euler

2017-03-15 Thread Don Guinn
Finally got the answer. Same one I had put in earlier but was rejected. Windows 10 had a big update overnight and the system rebooted. Who knows what happened. On Wed, Mar 15, 2017 at 1:48 AM, 'Mike Day' via Programming < [email protected]> wrote: > Only just up - having breakfast! I evi

Re: [Jprogramming] Project Euler

2017-03-15 Thread 'Mike Day' via Programming
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 requ