T = 6.283185307179586
omega: 2 * π / T
g(x) = abs(cos(x))
f(x) = g(x - floor(x / (2 * π)) * 2 * π)
a0: 1 / T * Integral[f, 0, 6.283185307179586]
k: 2 * π / T
a = Sequence(2 / T * Integral[f(x) * cos(n * omega * x), 0, 6.28319], n, 1, 5)
b = Sequence(2 / T * Integral[f(x) * sin(n * omega * x), 0, 6.28319], n, 1, 5)
N = 5 (slider from 0 to 5, step 1)
A = Sum(Sequence[Element[a, n] * cos(n * omega * x), n, 1, N])
B = Sum(Sequence[Element[b, n] * sin(n * omega * x), n, 1, N])
F(x) = a0 + A(x) + B(x)