Finding integer solutions of polynomials division

214 Views Asked by At

How can I find the integer solutions of the following problem

$\frac{2+16x-x^2}{2(3+x)}$

e.g. if $x=2$ then we have $\frac{30}{10}=3$

Context

I have a data with infinity columns and rows. I need to start at a cell and pick a path to go to another cell

e.g. If I pick 57 as start point and want to go to 55 as my goal, I need to move two cell right ($x=+2$) and three cell up (= $-3$ cell down) ($y=-3$)

$i$ $x_1=1$ $x_2=2$ $x_3=3$ $x_4=4$ $x_5=5$ $x_6=6$
8 15 28 39 48 55 60
9 17 32 45 56 65 72
10 19 36 51 64 75 84
11 21 40 57 72 85 96
12 23 44 63 80 95 108
13 25 48 69 88 105 120
14 27 52 75 96 115 132
15 29 56 81 104 125 144
16 31 60 87 112 135 156
17 33 64 93 120 145 168
18 35 68 99 128 155 180

Formula

For x move to right we have :

$value_{(n+x,i)}=value_{(n,i)}+(({o_{(n-1)}}_i)^2-({o_{(n-1-x)}}_i)^2)$

For y move to down we have :

$value_{(n,i+y)}=value_{(n,i)}+2*y_n*y$ ($y_n$ changes when we move horizontally and depended on $x$, see general form)

and

${o_(n)}_i = 2*i-2(x_n-1)-1$

and

$x_n=n$

In general form, For x move to right and y move to down we have

$value_{(n+x,i+y)}=value_{(n,i)}+(({o_{(n-1)}}_i)^2-({o_{(n-1-x)}}_i)^2)+value_{(n,i)}+2*(x_n+x)*y$

Example

In cell 57 we have x_3=3 and i=11, I am looking for a $x$ and $y$ to move to cell 55. The correct answer is $x=2$ and $y=-3$

I think the best solution for my problem is changing it to another problem (if you have better solution let me know)

For some boring reasons, I know that $57+(({o_{(2)}}_{11})^2-({o_{(2-x)}}_{11})^2)-55$ is dividable by $2*(x_3+x)$

which convert problem to finding integer solution for $\frac{2+16x-x^2}{2(3+x)}$

3

There are 3 best solutions below

1
On BEST ANSWER

If $2(x+3)$ divides $-x^2+16x+2$, then $x+3$ divides $-x^2+16x+2$. By polynomial long division $$-x^2+16x+2=(x+3)(-x+19)-55.$$ Hence $x+3$ divides $55$, i.e. $x+3\in \{\pm 1, \pm 5, \pm 11, \pm 55\}$. Thus $$x \in \{-58, -14, -8, -4, -2, 2, 8, 52\}.$$ We can check that indeed all of these $x$ values give an integer for the original expression.

5
On

Note that for there to be an integer solution, $2(3 + x)$ must divide $2 + 16x - x^2$. Or, to put this in terms of congruences, there is an integer solution precisely when $2 + 16x - x^2 \equiv 0 (mod\ 6 + 2x)$. Mind, you can't divide by zero - so there is no solution when $x = -3$.

If you add 4 to both sides then you'll have $6 + 16x - x^2 \equiv (6 + 2x) + 14x - x^2 \equiv 14x - x^2 \equiv 4 (mod\ 6 + 2x)$.

Note that $14 / 2 = 7$. So if we add $6 * 7 = 42$ to both sides then we can eliminate the $14x$ from the congruence altogether.

$42 + 14x - x^2 \equiv 7(6 + 2x) - x^2 \equiv -x^2 \equiv 46 (mod\ 6 + 2x)$.

Thus there is an integer solution wherever $x^2 \equiv -46 (mod\ 6 + 2x)$. Or equivalently, there is a solution when $x^2 = (6 + 2x)k - 46$ for some integer $k$.

Rearranging terms we get $x^2 -2kx -6k + 46 = 0$. See if you can find solutions in terms of $k$ by using the Quadratic Formula with a = 1, b = -2k, c = -6k + 46. Hope that helps.

2
On

For there to be integer solutions there must be integer solutions to the radical below. \begin{align*} \frac{2+16x-x^2}{2(3+x)}&=n\\ \implies x &= \pm\sqrt{n^2 - 22 n + 66} - n + 8 \end{align*}

The solutions are complex for $4\le n\le18$ but, for $\, -2500\le n \le 2500, \,$

\begin{align*} n&\in\big\{-17,-17,3,3,19,19,39,39\big\}\\ \implies x&\in\big\{-2,52,2,8,-14,-8,-58,-4 \big\} \end{align*} respectively.