1
$\begingroup$

As my search to create an efficient factorization algorithm continues, I stumbled upon this equation for one of my test cases:$$\dfrac{3-n^2}{2n-12}=k$$ To continue, I need to know what integer values of $n$ make $k$ an integer. Since I want this to be a factorization algorithm, I would like methods that don't include factoring; and since I want this to be efficient, I would like methods that doesn't include checking between a range. Other than those two exceptions, any method is accepted, no matter how complicated (I can always optimize it later).

$\endgroup$
3
$\begingroup$

Hint: If $A=\frac{3-n^2}{2n-12}$ has to be an integer, so does $2\cdot A$ $$=\frac{-2n^2+6}{2n-12}=-n-\frac{3-6n}{n-6}=-n-\frac{-6(n-6)-33}{n-6}=-(n+6)-\frac{33}{n-6}$$ and hence, you're looking for values of $n$, for which

$$\frac{33}{n-6}\in\mathbb Z$$

$\endgroup$
  • $\begingroup$ Yes but that would require a. Factorization, or b. Checking over a range, both of which I would not like. Are there any other methods? $\endgroup$ – Quote Dave Mar 29 at 18:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.