Integer solutions of a variable coefficient polynomial

modular arithmeticmultivariate-polynomialpolynomialsproblem solving

I have many equations to solve similar to this one:

$$2 a b^3 – a b^2 + a b – 2 a – b^4 + b^3 – 2 b^2 + 2 b = 0$$

Here, b is a base and a is a non-zero digit in a b-adic number, so $1 \leq a \leq b-1$

I am looking for integer solutions to this equation. Short of writing a program to test loads of numbers, what are my options for solving this?


My attempts:

Taking the equation $\pmod b$ we get:
$$- 2 a \equiv 0 \pmod b$$
Which implies a = b/2

Taking the equation $\pmod a$ we get:
$$- b^4 +b^3 – 2b^2 + 2b \equiv 0 \pmod a$$
$$ b^3 + 2b \equiv b^4 + 2b^2 \pmod a$$
$$ b^3 + 2b \equiv b(b^3 + 2b) \pmod a$$
$$ 1 \equiv b \pmod a$$
^something seems wrong with that equation

The only solution I know of for this particular equation is:
$(b,a) = (2,1)$


Another equation that I have is this one:
$$-b^4 + (2a_2-a_1)b^3 + (2a_1+a_2+3)b^2 – (2a_1+a_2)b + a_1-2-2a_2 = 0$$

For which I computationally determined the solutions:

$(b,a_1,a_2) = (5,3,3)$

$(b,a_1,a_2) = (10,6,7)$

$(b,a_1,a_2) = (15,9,11)$

$(b,a_1,a_2) = (20,12,15)$

Which yielded the linear relation $(b,a_1,a_2) = (b, \frac{3b}{5}, \frac{4b-5}{5})$

Plugging $a_1 = \frac{3b}{5}, a_2 = \frac{4b-5}{5}$ into the equation works.

My motivation for this: The equations I have found link to fixed points in the Kaprekar routine of a base b number.

Thanks in advance for any and all help, Ben

Best Answer

The first equation

$$2 a b^3 - a b^2 + a b - 2 a - b^4 + b^3 - 2 b^2 + 2 b = 0$$

can be written as

$$(b - 1) (2 a b^2 + a b + 2 a - b^3 - 2 b)=0$$

Since we have $b\ge 2$, dividing the both sides by $b-1\ (\not=0)$ gives

$$2 a b^2 + a b + 2 a - b^3 - 2 b=0$$ Solving for $a$ gives $$a=\frac{2b-1}{4}+\frac{5b+2}{4(2b^2+b+2)}$$ Multiplying the both sides by $4$ gives $$4a-2b+1=\frac{5b+2}{2b^2+b+2}$$

Since the RHS has to be a positive integer, we have to have $$\frac{5b+2}{2b^2+b+2}\ge 1,$$ i.e. $$0\le b\le 2$$ from which $b=2$ follows.

So, the only solution for the first equation is $$\color{red}{(a,b)=(1,2)}$$


The second equation $$-b^4 + (2a_2-a_1)b^3 + (2a_1+a_2+3)b^2 - (2a_1+a_2)b + a_1-2-2a_2 = 0$$ can be written as $$(1-b) (b^3 + b^2 a_1 - 2 b^2 a_2 + b^2 - b a_1 - 3 b a_2 - 2 b + a_1 - 2 a_2 - 2)=0$$

Since we have $b\ge 2$, dividing the both sides by $1-b\ (\not=0)$ gives $$b^3 + b^2 a_1 - 2 b^2 a_2 + b^2 - b a_1 - 3 b a_2 - 2 b + a_1 - 2 a_2 - 2=0$$ which can be written as $$(b^2-b+1)a_1+\{-2(b^2-b+1)-5b\}a_2+\{(b+2)(b^2-b+1)-b-4\}=0$$

So, we have $$5ba_2\equiv -b-4\pmod{b^2-b+1}$$ Multiplying the both sides by $b-1$ gives $$5b(b-1)a_2\equiv (b-1)(-b-4)\pmod{b^2-b+1},$$ i.e. $$5\{(b^2-b+1)-1\}a_2\equiv -(b^2-b+1)-4b+5\pmod{b^2-b+1},$$ i.e. $$5a_2\equiv 4b-5\pmod{b^2-b+1}$$ So, there has to be an integer $k$ such that $$5a_2=(b^2-b+1)k+4b-5$$ Using $1\le a_2\le b-1$, we have $$5\le (b^2-b+1)k+4b-5\le 5b-5,$$ i.e. $$\frac{-4b+10}{b^2-b+1}\le k\le \frac{b}{b^2-b+1}$$

Let $f(b),g(b)$ be the left fraction and the right fraction respectively.

Then, we have $f(2)=\frac 23=g(2)$.

Also, we have $-1\lt f(b)\lt 0$ and $0\lt g(b)\lt 1$ for $b\ge 3$.

So, $k=0$ for $b\ge 3$ from which $$5a_2=4b-5$$ follows.

It follows that $b=5m$ where $m$ is a positive integer and that $$a_2=4m-1,\qquad a_1=3m$$ and these are sufficient.

Therefore, the only solutions for the second equation are $$\color{red}{(b,a_1,a_2)=(5m,3m,4m-1)}$$ where $m$ is any positive integer.

Related Question