
function's formula
Hello.
How could I make a description of the function which relate an argument and a value this way:
x y
0 0
1 1
2 2
...
6 6
7 5
8 4
...
12 0
13 1
14 2
etc...
This is obviously periodic function, so I can write that f(x)=f(x+12) but how could I give a comprehensive formula for order of y? Should I write piecewise definition or rather recursive, or...?
Thanks for all help.

Hello, yosso!
I don't have a complete solution yet,
. . but I have some ideas . . .
We can describe the first "cycle" with this function:
. .
We can also describe the first cycle with a piecewise function:
. .
Either way, we must make it cyclic with a period of 12.
Hmmm . . .

That looks like a complete solution to me! It is a "sawtooth" function.

If it is a sawtooth function, there should be (or )isn't it? So, it is true for arguments from 0 to 6, but it is not true in refference to numbers following last one. Maybe it could be better to define values in connection of multiples of arguments? For there is true, that and for , , etc.