function y = ATimes(x,diagonal)
 % realizes: y=A*x; initialize by: diagonal = primes(p_n)'
 y = diagonal.*x; n=length(x);
 for k=1:n-1,for j=2.^(0:floor(log2(n-k))), y(k)=y(k)+x(k+j); end,end
 for k=2:n,  for j=2.^(0:floor(log2(k-1))), y(k)=y(k)+x(k-j); end,end
return