As Barry Cipra noted in the comments, a better framing of the question might be that I'm looking at absolute differences $|a−b|$ or totals $a+b$ for $5$-smooth numbers $a$ and $b$ satisfying the conditions $a>b>1$, gcd$(a,b)=1$, and $30∣ab.$

Original question

Is it true that $251$ cannot be made out of the absolute difference between (or total of) $2$ coprime numbers made up out of ALL the prime factors $2,3,$ and $5$ (with minimum exponent:$1$)?

$251, 431, 487, 499, 539, 541, 583, 593, 599, 617, 641, 713, 727, 731, 751, 761, 767, 781, 811, 823, 853, 857, 863, 877, 899, 901, 941, 943, 953, 961, 971, 983\dots$

or alternatively,

$251,431,487,499,7^2\cdot 11,541,11\cdot 53,593,599,617,641,23\cdot 31,727,17\cdot 43,751,761,13\cdot 59,11\cdot 71,811,823,853,857,863,877,29\cdot 31,17\cdot 53,941,23\cdot 41,953,31^2,971,983\dots$

I would be interested if any of these numbers can be "knocked off" the list. I have tried combinatorally up to exponent $70$ but have found nothing. Interestingly, the largest exponent used in any other number $<1000$ is $11$.

The list of numbers coprime to $2,3$ and $5$ begins:

\begin{align} &| 3-2\cdot 5|&=&7 \\ &|3\cdot 5 -2^2|&=&11\\ & |3\cdot 5-2|&=&13 \\ &| 3-2^2\cdot 5|&=&17 \\ &|5-2^3\cdot 3|&=&19 \\ &|5^2-2^4\cdot 3|&=&23\\ &|3^2\cdot 5-2^4|&=&29 \\ &|5-2^2\cdot 3^2|&=&31 \\ &|3-2^3\cdot 5|&=&37\\ &|3^2\cdot 5-2^2|&=&41\\ &|5-2^4\cdot 3|&=&43 \\ &|3-2\cdot 5^2|&=&47 \\ &|3\cdot 5-2^6|&=&49\\ &|3^3-2^4\cdot 5|&=&53 \\ &|3\cdot 5^2-2^4|&=&59\\ &|3^4-2^2\cdot 5|&=&61 \\ &|5-2^3\cdot 3^2|&=&67\dots\\ \end{align}

with exponent $11$ example:

\begin{align} &|3^2\cdot 5^3-2^{11}|&=&923\\ \end{align}

$15$ being the highest exponent in all combinations up to exponent $70$:

\begin{align} &|3^8\cdot 5-2^{15}|&=&37\\ \end{align}

I have a feeling the problem may be related to the McNugget numbers, but I am not sure. I can't think of a reason why all numbers coprime to $2,3$ and $5$ can't be generated in this way, and would be very interested if someone could point out why it should not be the case.

I would also like to know whether this is an $NP$-hard problem, or whether there is a more economic approach than to exhaust all combinations.


Leaving out anything to exponent $0$ is an important restriction, since if ignored, the resultant list becomes all integers, as opposed to all integers coprime to $2,3$ and $5.$

  • $\begingroup$ You mean that $2,3$ and $5$ must be used at least in one of the two numbers ? $\endgroup$
    – Traklon
    Commented Oct 31, 2014 at 15:59
  • $\begingroup$ @Traklon yes, exactly. $\endgroup$
    – martin
    Commented Oct 31, 2014 at 16:00
  • $\begingroup$ @Traklon for example: $\{2,3\cdot5\},$ or $\{2^{8}\cdot 3^{25},5^{10}\},$ etc. $\endgroup$
    – martin
    Commented Oct 31, 2014 at 16:08
  • 2
    $\begingroup$ @martin, if I understand correctly what you're asking for, you're looking at differences $a-b$ for $5$-smooth numbers $a$ and $b$ satisfying the conditions $a\gt b\gt1$, $\gcd(a,b)=1$, and $30\mid ab$. When $a-b$ is prime, the condition $\gcd(a,b)=1$ is superfluous. $\endgroup$ Commented Oct 31, 2014 at 19:37
  • 1
    $\begingroup$ 797 = 2^5 * 5*2 - 3 $\endgroup$ Commented Nov 2, 2014 at 17:18

1 Answer 1


This is a computer-supported solution which doesn't provide much insight into the rules describing why some numbers can and others cannot be expressed. Also, I didn't double-check the calculations yet (especially the exhaustive part), so if anyone wants to verify them independently, be my guest!

Observation 0: There are only finitely many possibilities of representing a positive number as sum of two positive numbers; so these can be ruled out by exhaustive search. We will thus focus only on the "difference" case.

Observation 1: If we have $a-b=n$, we also have $a-b=n\pmod q$ for any positive integer $q$. Thus, in order to prove that $n$ cannot be expressed as difference of two numbers (of particular form), it's sufficient to show that it is impossible to do so modulo suitably chosen integer $q$.

Observation 2: If we have fixed positive integers $x$ and $q$, there are only finitely many values that $x^k\bmod q$ can attain for different positive powers $k$. If we start with $k=1$ and keep increasing it, it's sufficient to go until we encounter some value which we have seen already; all the following ones will be duplicates.

Consider $q=4095$. We have:

  • $2^{13}\equiv 2^1\pmod q$,
  • $3^{14}\equiv 3^{2}\pmod q$ and
  • $5^{13}\equiv 5^1\pmod q$

Thus, it's sufficient to consider $2^a$, $3^b$, $5^c$ (all modulo $q$) with $1\leq a\leq 12$, $1\leq b\leq 13$ and $1\leq c\leq 12$ when building up the possible values. As it turns out, none of the differences turns out to be congruent to $251$ modulo $q$; so the number $251$ is not expressible in the desired form at all.

We have actually ruled out all the numbers congruent to $251$ modulo $4095$, not just $251$ itself. The "witness" $q=4095$ also works for other numbers from the list -- e.g. $731$ or $877$. Other numbers in the list might need other witnesses: for example, $487$ should be covered by $q=6552$ and $431$ by $q=94535$.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .