// THIS FILE ACCOMPANIES THE PAPER "Scrollar invariants, syzygies and representations of
// the symmetric group" BY W. CASTRYCK, F. VERMEULEN AND Y. ZHAO. IT COMPUTES VALUES OF
// THE SCROLLAR INVARIANTS OF THE PARTITION P FOR SMOOTH CURVES OF BIDEGREE (c, d = &+P) 
// ON THE HIRZEBRUCH SURFACE F_e, AS THEY ARE PREDICTED BY CONJECTURE 44

P := [2, 2, 2];
c := 1;
e := 2;

d := &+P;

function ReadingWord(T)
  tableau := Eltseq(T);
  return &cat(Reverse(tableau));
end function;

function index_set(W);
  Is := [];
  index := Index(W, 1);
  for i in [2..#W] do
    new_index := Index(W, i);
    if new_index lt index then Is cat:= [i-1]; end if;
    index := new_index;
  end for;
  return Is;
end function;

list_s := [];
for T in StandardTableaux(P) do
  W := ReadingWord(T);
  I := index_set(W);
  scrollinv := 2*#I - 2;
  for i in I do
    scrollinv +:= c + i*e - 2;
  end for;  
  list_s cat:= [scrollinv];
end for;
list_s := Sort(list_s);
print list_s;
