function res = potw(x,n)

s = 0;

for k = 1:n
    s = s+ k^(-2)*cos(x*2^(-k));
end

res = s;

end

