integer function icant(i,j) integer i,j if (i.ge.j) then icant=(i*(i-1))/2+j else icant=(j*(j-1))/2+i endif return end