How to find number pairs $(a,b)$ s.t. $a^2-b^2 = ab$ (in decimal representation)?

121 Views Asked by At

Question is in the title. For clarification $ab$ does not mean $a\cdot b$, but the decimal representation $a\cdot 10^{\lfloor\log_{10}b\rfloor+1} + b$. For example $(14,7)$ works because

$14^2-7^2 = 196-49 = 147$,

so they fulfill this pattern. I think solving the general formula shouldn't be that hard, but I have problems including the floored logarithms of $b$.

I'm interested in a special format (like there is for Pythagorean triplets) to find all number pairs that satisfy the given condition $$ a^2-b^2 = a\cdot 10^{\lfloor\log_{10}b\rfloor+1} + b $$ and how many of those number pairs exist. I would suggest there are infinitely many, but I can't prove it.

Edit: By trial and error I found - as it seems - infinitely many of those type, namely $(134, 67)$, $(1334, 667)$, $(13334, 6667), ...$ because: $$ 134^2-67^2=13467 \\ 1334^2-667^2=1334667 \\ \vdots $$ Are these the only possible combinations? Does this really work infinitely long? If so why?

Edit2: I've written a program to find those pairs. All pairs for $a<10^5$ are: $$ (14,7),(134,67),(1010, 100), (1016, 127), (1034, 187), (1140, 399), (1190, 475), (1216, 512), (1300, 624), (1334, 667), (1416, 767), (1484, 847), (1530, 900) $$

One could also see that $b$ always has one digit less than $a$ (so that the final amount of digits work out) and that $a < 1.62 \cdot 10^n$, because otherwise the smallest number of the form $a^2-b^2$ we can get is

$$a^2-(10^{n}-1)^2 \geq (1.62\cdot 10^n)^2 - (10^n-1)^2 \geq 2.6244\cdot 10^{2n} - 10^{2n} > 1.62\cdot 10^n$$ so we wouldn't be able to get $ab$ as decimal representation.

2

There are 2 best solutions below

1
On BEST ANSWER

Here is my partial work:

I tried to solve the relaxed equation $a^2-b^2=a\cdot 10^k + b$ and verify the restriction $k=10^{\lfloor\log_{10}b\rfloor+1}$ later.

I multiplied by 4 and used $(2x\pm y)^2=4x^2\pm 4xy+y^2$ to get:

$\left(2a-10^k\right)^2-\left(2b+1\right)^2=10^{2k}-1$

Which can be further written:

$(2a-2b-10^k-1)(2a+2b-10^k+1)=10^{2k}-1$

To make further progress, I would need a formula for factorization of $10^{2k}-1=99\ldots 99$, which does not exist AFAIK. So chances are that you would not be able to find a formula for the general solution, although the problem is solvable for small values of $k$.

However, it is possible to generate infinite sequences of solutions by using particular factorizations. For example, $\underbrace{99\ldots99}_{2k \text{ digits}}=\underbrace{3\ldots3}_{k \text{ digits}}\cdot 300\ldots 03$ will generate the sequence which you found.

0
On

An addition to @Momo's answer:

As seen here there is no real pattern behind the divisors of $10^{2k}-1$. However, we know that $3,9$ and $11$ as well as $\underbrace{1...1}_{r}$ for $r | 2k$ are divisors of $10^{2k}-1$. We can use that to find all infinite patterns. But first let's figure out the general formula of $a$ and $b$ given the two factors $p\cdot q = 10^{2k}-1$:

\begin{align} 2a-2b-10^k-1&=p \\ 2a+2b-10^k+1&=q \\ \\ \Rightarrow 4a-2\cdot 10^k &= p+q \\ \Rightarrow a &= \frac{p+q+2\cdot 10^k}{4} \\ \\ \Rightarrow b &= \frac{q-2a+10^k-1}{2} = \frac{q-\frac{p+q+2\cdot 10^k}{2}+10^k-1}{2} \\ \Rightarrow b &=\frac{q-p-2}{4} \end{align}

Therefore we assume $p<q$ so that $b>0$.

We know of the following decomposition which exist for all $k\in\mathbb{N}$ (coming from divisors $3,9,11,\underbrace{1...1}_{k}$):

\begin{align} 10^{2k}-1 &= 3\cdot \underbrace{3...3}_{2k}=9\cdot \underbrace{1...1}_{2k} = 11\cdot \underbrace{909...909}_{2k-1}=33\cdot \underbrace{303...303}_{2k-1} = 99\cdot\underbrace{101...101}_{2k-1} \\ &=\underbrace{1...1}_{k}\cdot \underbrace{90...09}_{k+1} = \underbrace{3...3}_{k}\cdot\underbrace{30...03}_{k+1} = \underbrace{9...9}_{k}\cdot\underbrace{10...01}_{k+1} \end{align}

Which solutions do those equations give? For $k=3$ we get (listed as in the equations above): \begin{align} (83834, 83332), \\ (28280, 27775), \\ (23230,22724), \\ (8084, 7567), \\ (3050,2500), \\ (2780,2224), \\ (1334,667), \\ (1000, 0) \\ \end{align}

To get a working example we need $b$ to have exactly one digit less than $a$. That means that there exists only one infinitely repeating pattern with the factors $\underbrace{3...3}_{k}$ and $\underbrace{30...03}_{k+1}$ given by $(a,b)=(13...34,6...67)$. All other solutions depend on factors which can not be infinitely repeated.

For example: $13$ is a factor for $k=3$ but not for $k=4$, that's why we get another solution for $k=3$ using $p=13\cdot 37=481,q=2079\Rightarrow (1140,399)$, but this solution cannot be infinitely repeated because we can't create a pattern as not all $10^{2k}-1$ are divisible by $13$.