f = If(x ≤ 0.5, 2 * x, 2 - 2 * x)
g(x) = f(x - floor(x))
n = 0 (slider from 0 to 10, step 1)
h = Sum(Sequence[g(2^(k) * x) / 2^(k), k, 0, n], n + 1)