Looks like the polya code is getting the correct answer (matched
Rod's code and Maple on several non-trivial cases). test_polya.py is
the code that does a complete problem. Time to rethink the thing from
scratch and code up in fortran.