λ=N[Sqrt[5]-1]/2;
ϕ[_][x_] := x;
ϕ[ns___,n_, nn_][x_] := Module[
{
s=Times[ns,n],
x0, y0, x1, y1, mu
},
y0=ϕ[ns,n][x0 = Floor[s*x]/s];
mu=1/s^2;
If[(x-x0)*s*nn<nn-1,
(*then*) y0+mu*(x-x0),
(*else*) y1=ϕ[ns,n][x1 = x0+1/s];
x0+=(nn-1)/nn/s;
y0+=mu*(nn-1)/nn/s;
y0+(y1-y0)/(x1-x0)*(x-x0)
]
]

Plot[{ϕ[2][x], ϕ[2,3][x], ϕ[2,3,4][x], ϕ[2,3,4,5][x]}, {x,0,1}]

Plot[{ϕ[3][x], ϕ[3,3][x], ϕ[3,3,3][x], ϕ[3,3,3,3][x]}, {x,0,1}]