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

I have a question. For $x,y,n \in\Bbb N$, $y$ a power of two, being given $x$ and $y$ is there a faster way to mentally calculate $ny$ where $ny ≤ x< (n+1)y-1$ other than $\lfloor x \div y \rfloor \times y$? Thanks.

share|cite|improve this question
Perhaps you want $ny \leq x$, otherwise $x = 2$ and $y = 2$ will have no solutions. – Benjamin Dickman Nov 14 '12 at 4:30
@B.D yes, thank you – octavian Nov 14 '12 at 4:42
All I can think of is the usual $2^{10} \approx 1,000$ and its powers can get you $n$ with less calculation (as long as it isn't too close). – Ross Millikan Nov 14 '12 at 4:56
@RossMillikan I figured out one thing you could do would be x-x%y, that also gives you ny – octavian Nov 15 '12 at 8:40

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.