Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

There are nonzero natural numbers ($\geq 1$) $a,b,c,d$.

$c$ is fixed, and prime factorization of $c$ is available. The prime factorization of $c$ always have the same nonzero exponent - that is $2^z3^z5^z...$ where $z$ is the exponent. And


We define another nonzero natural number $$k = \frac{c}{p^z}$$ where $p$ is some prime factor of $c$.

The question is, what would be a way to minimize $|a-b|$ while $a+b$ is multiples of $k$? I wish to find the method for every possible number of prime factors in $c$.

(If $z=1$ and $c$'s prime factors being all prime numbers from 2 to some number makes cases much easier, that's also fine.)

Difference is nonzero, and $a,b,d$ can be set freely as long as they satisfy constraints.

share|cite|improve this question
possible duplicate of Integer factorization that satisfies factor multiplication constraints --- probably a better idea to edit the old question than to post a new one while the old is unresolved. – Gerry Myerson Nov 3 '12 at 5:09
I just deleted the question, as I found no way to rescue it... It was too unclear from beginning. – La Ventana Nov 3 '12 at 9:14
Maybe it would be better if you just explained why you are interested in such a bizarre-looking question. – Gerry Myerson Nov 3 '12 at 11:29
I am working through some "joke" assignments... That's why. Haha. That's why it seems bizarre - as it is part of my attempts trying to solve a problem. May be flawed, but just trying. Isn't it better to try one's own approach? :) – La Ventana Nov 3 '12 at 11:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.