Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

How would one solve an equation with a floor function in it:

$$a - (2x + 1)\left\lfloor{\frac {a - 2x(x + 1)}{2x + 1}}\right\rfloor - 2x(x + 1) = 0$$

$a$ is a given and can be treated as a natural number, and all $x$ other than integers can be discarded. At least one non-trivial solution would be sufficient.

Maybe an algorithmic method could be used?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Rearranging we get,

$$\frac{a - 2x(x + 1)}{(2x + 1) } =\left\lfloor{\frac {a - 2x(x + 1)}{2x + 1}}\right\rfloor $$

This means,$\frac{a - 2x(x + 1)}{(2x + 1) }$ is an integer.

$$\frac{a - 2x(x + 1)}{(2x + 1) }=k$$

$$a=2xk+k+2x^2+2x$$

$$2x^2+2(k+1)x+k-a=0$$

Applying the quadratic formula,

$$x = \frac{-2(k+1)\pm\sqrt{4(k+1)^2-8(k-a)}}{4}$$

$a$ is known, now we substitute integers in place of $k$ to obtain solutions.

share|improve this answer
    
Awesome. Thanks. –  Desmond Hume Mar 25 at 14:58
    
Oh, one last question. Is there a way to skip those $k$ that don't result in integer $x$? –  Desmond Hume Mar 25 at 16:27
    
@DesmondHume one thing to note would be $k$ has to be odd, so that should significantly lower your false $k$. –  Sabyasachi Mar 25 at 16:50
    
So no way to keep $x$ integer? –  Desmond Hume Mar 25 at 17:02
    
@DesmondHume maybe I can improve the analysis if you can give me $a$ before hand. –  Sabyasachi Mar 25 at 17:04

Your Answer

 
discard

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

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