# Finding general formula for this recursion function

I have a recursion relation defined as

Clear[f];
f[x_] := 0 /; 0 <= x < π/3;
f[x_] := x - π/3 /; π/3 <= x < 2 π/3;
f[x_] := f[x - 2 π/3] + π/3 /; x >= 2 π/3;
f[x_] := -f[π/3 - x] /; x < 0;

Plot[f[x], {x,-2Pi,2Pi}, Ticks->{Range[-2π,2π,π/2], Automatic}]


I'm unsure of where to go from here to find the solution. RSolve seems doesn't worked.

How to use Mathematica to find it?

• Maybe h[x_] := Max[Mod[x, 2/3 \[Pi]] - \[Pi]/3, 0] + Quotient[x, 2/3 \[Pi]] \[Pi]/3 ? – b.gates.you.know.what Jan 9 '18 at 8:16
• ... Is this a math question or a Mathematica question? The answers here give "the mathematical result", not "how to use Mathematica to find it". – user202729 Jan 9 '18 at 9:51

f2[x_] := If[EvenQ[#], # π/6, (# - 1) π /6 + #2] & @@ QuotientRemainder[x, π/3];