I need to find the samllest positive integer value of a for which $(n - a) / (1 + 2 a)$ is an integer. where n is a given natural number .
In other words solve diophantine equation for postive $a$, $b$,
$a+b+2ab=n$
To make it more specific I am only interested in the smallest value of $a$.
Since some users are confused with the problem statement I want to re-emphasize that the value of n is given or constant. You don't need to solve for all values of n, you just need to solve for one particular value of n. You can assume n to be any large integer say if $n = 1000$, then you are to solve $a+b+2ab=1000$
My thoughts so far:
Since we can express $b(1+2a)=n-a$
is to try out all values of $a=1 \to \sqrt{n}$
WLOG we assume $a<b$, then $a$ is bound to be less than $\sqrt{n}$ so we reduce search space somewhat.
But its not very efficient way.