Re: [Jprogramming] Math Problem

2021-10-19 Thread Adrien Mathieu
As Elijah pointed out, you probably are interested only in the rational solutions, since there an infinity of real solutions, most of which are likely to be irrational. You can even locate them. Assume you have an integer b, such that b(b+1) > a (where a is the number you are trying to reach –

Re: [Jprogramming] Math Problem

2021-10-19 Thread Elijah Stone
On Tue, 19 Oct 2021, Elijah Stone wrote: 0 = (64*x*x) + (_4096*x) + 4002 Another foolish mistake! It should be '- 4002', not '+ 4002'. (The answer is still correct; but I did not correctly reproduce my workings.) -- For in

Re: [Jprogramming] Math Problem

2021-10-19 Thread Skip Cave
Thanks Elijah! That's what I was missing. We could also use J's polynomial solver: * ] 'x f' =. ; }. p. 4002 _4096 64* *63.00755956214548803 0.99244043785451341311* Looks good: * 4002=64*x*f* *1* But only if we rely on J's comparison tolerance. If we move to rational fractions: * ] 'x f'

Re: [Jprogramming] Math Problem

2021-10-19 Thread Elijah Stone
On Tue, 19 Oct 2021, Elijah Stone wrote: The solution with a floor of k has a determinant of (k^4) + 4*k. Are there any values for k in range such that that value is a perfect square? 1 e. (= <.) %: (^&4 + 4&*) >:i.150 0 It appears not :/ Ah, no, I made a foolish mistake. The determin

Re: [Jprogramming] Math Problem

2021-10-19 Thread Elijah Stone
Ah--that is much clearer! I am not sure of a good iterative solution, but there is a fairly simple analytic solution. Say we would like to find a solution with a floor of 64; that is, where 64 = <.x. Then we have: 4002 = x * 64 * (x - 64) = (64*x*x) + (_4096*x) which means that: 0 = (64*

Re: [Jprogramming] Math Problem

2021-10-19 Thread Skip Cave
I made a mistake in the equation in my first post.. The three terms that are multiplied are 1. x 2. floor of x = (<.x) 3. fractional part of x = (x - <.x) This is what I got wrong in my first post. I can get close by manual trial & error: *x=.64.962573478* Floor of x = <.x = 64 Fractional par

Re: [Jprogramming] Math Problem

2021-10-18 Thread Devon McCormick
Maybe this? c3=. (%3)^~poss=. 4002x */ >:i.999 n=. poss%(<.c3)*>.c3 1 e. poss=n*(<.n)*>.n 1 On Mon, Oct 18, 2021 at 8:02 PM Raul Miller wrote: > I think that 64 is too big. >64^3 > 262144 > > I don't think this one has a solution, because 4002%15*16 is too > large, and 4002%16*17 i

Re: [Jprogramming] Math Problem

2021-10-18 Thread Raul Miller
I think that 64 is too big. 64^3 262144 I don't think this one has a solution, because 4002%15*16 is too large, and 4002%16*17 is too small. I haven't explored gaussian integers here, but my gut feeling is that there won't be any viable candidates there, either. I hope this helps, -- Raul

[Jprogramming] Math Problem

2021-10-18 Thread Skip Cave
How to solve this problem? 4002x = n * (<.n) * (>.n) What is n, where n is a rational fraction greater than 1, and the answer is a rational fraction? There are likely many answers, so find some answers near 64. The result in J should be a 1: 4002x = n * (<.n) * (>.n) 1 Skip Skip Cave Cave Co