function [joj,i,j] = Jbar_ind(n);
  
% gangster indices without redundant arrow part
% 08.02.2002, rsotirov, klagenfurt
% call: [Jb,i,j] = Jbar_ind(n); 


if n<3
disp('MUST BE: n =>3');
Jb = [];
IJ = [];
break;
end;

Jb = zeros(n*n+1);        % off diagonal elements for the diagonal blocks
r = 1:n;                  % must: q<>r
for p = 1:n
for q = 1:n
I = setdiff(r,q);
redak = (p-1)*n + q +1;
if mod(redak-1,n) == 0,
else
Jb(redak, (p-1)*n + I +1) = 1;
end;

end;
end;


r = 1:n-1;                % diagonal elements of the off-diagonal blocks
for p = 1:n-1             % must: p<>r; p,r <> n
for q = 1:n
I = setdiff(r,p);
Jb((p-1)*n + q +1, (I-1)*n + q + 1) = 1;
end;
end;

rr=1:n;
Jb((n-3)*n+1+rr, (n-2)*n+1+rr)=0;    % (r,p), (p,r) <> (n-2,n-1), (n-1,n-2)
Jb((n-2)*n+1+rr, (n-3)*n+1+rr)=0;

% throwing out lin. dep. part
joj= n:n:n*n+1;
joj1=joj-1;
Jb(joj,joj1)=0;

joj = tril(Jb ,-1);
[i,j] = find(joj);                   % find on which postions should be zeros


