http://totalmatrix.blogspot.com/2008/06/invariants-of-primary-systems.html