finding perfect squares solutions for the following case

61 Views Asked by At

I was working on a number theory problem and create a equation. I tried research on this, but tbh I don't even know what should I google for... Here's my cases.

$$n = \sqrt{N * \frac{1+\sqrt{4k^2+1}}{2}}$$ $$m = \sqrt{N * \frac{\sqrt{4k^2+1}-1}{2}}$$

Where N is a given integer, m, n are both unknown integers, k has a given range of [0, 10] and k is a real number.

My question is, What is the fastest way to find such k that create integers m and n?

Thanks in advance!

1

There are 1 best solutions below

7
On BEST ANSWER

Given the range in $k$, you have $$1+\frac {\sqrt{337}}{18} \le \frac {1+\sqrt{1+4k^2}}2\le 1+\frac {5\sqrt{13}}2$$ The left side is a little more than $2$ and the right a little more than $10$. The range of $n$ that is available is from $\left\lceil\sqrt{\left(1+\frac {\sqrt{337}}{18}\right)N}\right\rceil$ to $\left\lfloor\sqrt{\left(1+\frac {5\sqrt{13}}2\right)N}\right\rfloor$ inclusive. Choose your $n$ and solve the equation for $k$.

For your new problem with $m,n$, note that the radicands differ by $N$, so we can write $n^2-m^2=N=(n+m)(n-m)$. The two factors $n+m$ and $n-m$ have the same parity, so if $N$ is divisible by $2$ and not $4$ there is no solution. Otherwise, each way of factoring $N$ into two factors of the same parity give a solution to $n=\sqrt {aN+\frac N2}, m=\sqrt{aN-\frac N2}$. For each factorization, you can see if $a$ is in the range at the top of my post. If it is, $k$ will be in range, otherwise not.