split the integral into three parts.
[0,1/3], [1/3,2/3], and [2/3,1]
the integral over [1/3, 2/3] is the integral of 1/2 x over the same interval, so it is 1/12.
For the other two parts, use the following
Use a(x+2/3) = a(x)+1/2 for x in [0,1/3]
and a(x/3) = 1/2 a(x) for x in [0,1].