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

How can we find a function for a conversion table with the following properties? The range of both inputs and outputs is $[0..100]$; inputs are integers.

$$f(0) = 0$$ $$f(100) = 100$$ $$f(1) - f(0) = 2(f(100) - f(99))$$

So, $f(1)$ should be $1.\bar3$ and $f(99)$ should be $99.\bar3$. The difference between subsequent outputs is linearly decreasing, so $f(50)-f(49)\approx 1$.

share|cite|improve this question
up vote 5 down vote accepted

Let $a_n=f(n)-f(n-1)$. Then $a_1=\frac{4}{3}$ and $a_{100}=\frac{2}{3}$. Since the differences are linearly decreasing, we have $a_n=\frac{4}{3}-\frac{n-1}{99}\frac{2}{3}$.

Hence $f(n)=a_n+...+a_1+f(0)=\frac{4n}{3}-\frac{2}{297}(1+...+(n-1))=\frac{4n}{3}-\frac{n(n-1)}{297}=\frac{n(397-n)}{297}$.

share|cite|improve this answer
Thank you very much. Now I can use the same logic to verify for different ratios (where ratio in my example was 2, between $f(1)-f(0)$ and $f(100)-f(99)$). – ΤΖΩΤΖΙΟΥ Dec 12 '12 at 13:36
Thanks for the question edit, although outputs obviously aren't integers. I fixed that. – ΤΖΩΤΖΙΟΥ Dec 13 '12 at 17:06

Your Answer


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.