1

I have the following coordinates:

( 1, 1)
( 2, 1)
( 3, 3)
( 4, 1)
( 5, 3)
( 6, 5)
( 7, 7)
( 8, 1)
( 9, 3)
(10, 5)
(11, 7)
(12, 9)
(13,11)
(14,13)
(15,15)
...
...
etc.

basically: the y values are all odd numbers in ascending order but they start over from 1 if the next value exceeds the value of x.

Here is a graph: enter image description here

Ahmad
  • 113
  • This looks like a modified version of the sawtooth function http://en.wikipedia.org/wiki/Sawtooth_wave – Mankind Apr 26 '15 at 10:19

2 Answers2

4

You might observe that $f(2^n)=1$ and $f(2^n+k)=2k+1$ if $0 \le k \lt 2^n$, though you might want to prove it.

So consider whether you can define $k=x-2^{\lfloor \log_2 x \rfloor}$ and so $$f(x)=2x-2^{1+\lfloor \log_2 x \rfloor}+1.$$

Henry
  • 157,058
3

On can observe that $y=2(x-2^k)+1$ in $2^k\leq x<2^{k+1}$ or $k\leq \frac{\ln(x)}{\ln(2)}<k+1$ hense $k=\left \lfloor\frac{\ln(x)}{\ln(2)}\right \rfloor$

So, the function is : $$y=2\left(x-2^{\left \lfloor\frac{\ln(x)}{\ln(2)}\right \rfloor}\right)+1$$ where $\lfloor \, \rfloor$ is the symbol of the floor function.

JJacquelin
  • 66,221
  • 3
  • 37
  • 87