function [i,j] = sub2indsym(tmp)

k = (1 + sqrt(1 + 8*tmp))/2; % let k be column. Then k(k-1)/2 <= tmp
j = ceil(k);
i = tmp - floor(k)*(floor(k) - 1)/2;
if i == 0
  i = floor(k) - 1;
end