Wait til you get to 24. That one was the most difficult for me. It's not
really about programming, more like an old-fashioned logic puzzle.
On Wed, Jan 5, 2022 at 4:08 PM 'Michael Day' via Programming <
programm...@jsoftware.com> wrote:
> I don't think there are any spoilers here.
>
> Well, I ha
er wrote:
> >
> > Personally, I have yet to solve 24. I'm still working on the second half
> of 23.
> >
> > --
> > Raul
> >
> >> On Thu, Jan 6, 2022 at 1:30 PM Eugene Nonko wrote:
> >>
> >> Wait til you get to 24. That one wa
> add digit13 7 NB. Y249=: Y248 add 7[ 8 thru 16
> mul Y249 X241 NB. Y250=: Y249 mul X241 [ 0 thru 16
> add Z246 Y250 NB. Z251=: Z246 add Y250 [ 0 thru 5520918016
>
> I am currently working on some tree unification mechanisms (maximum
I need to find the smallest number that divides all numbers from 1 to n.
The solution, of course is this:
*./ >: i. n
What I don't understand is why this solution seems to scale so poorly:
6!:2 '*./ >: i.1x'
0.326128
6!:2 '*./ >: i.11000x'
1.00384
6!:2 '*./ >: i.12000x'
4.133
6!:
Haskell does not have any clever way to short-circuit evaluation of LCM for
arbitrary precision Integer type.
LCM is defined as follows:
lcm _ 0 = 0
lcm 0 _ = 0
lcm x y = abs ((x `quot` (gcd x y)) * y)
And GCD is implemented straightforwardly using Euclid algorithm:
g
in J, and the fact that *. must manipulate these
> extended precision integers more often than other verbs.
> >
> > Indeed, If you remove the 'x', it runs extremely fast.
> >
> > From: Programming on behalf
> of Eugene Nonko
> > S
Hello,
Can someone please explain this:
0 % 0
0
Thanks,
Eugene
--
For information about J forums see http://www.jsoftware.com/forums.htm
Hello,
I have this recursive dyad defined to calculate modular matrix exponential
by squaring:
pow =: 4 : 0
if. y = 1 do.
x
else.
(] ` (x & mul) @. (2 | y)) mul~ x pow <. -: y
end.
)
(mul verb can be defined to perform simple multiplication, then it will
work for regu
I think a lot of people here would enjoy that:
https://ed-thelen.org/comp-hist/APL-hist.html
-- Eugene
--
For information about J forums see http://www.jsoftware.com/forums.htm