// Frobenius notation of a partition (Vincent Prosper, 1998)

combinat::partitions::toFrobenius :=
proc(combinat::partitions lambda) 
local i,n;
begin
  n := nops(lambda);
  for i from 1 to n do
    if (op(lambda, i) < i) then
      n := i-1;
      break;
    end_if;
  end_for;
  // n is now the number of cells of lambda on the diagonal
  [[lambda                                 [j]-j $ j=1..n],
   [combinat::partitions::conjugate(lambda)[j]-j $ j=1..n]];
end_proc:
