Factor
Represents a prime factor which we need to keep track of.
The first field 'p' is the prime itself. The 'next' field is the next multiple of the prime that we expect to see.
We use a slightly non-standard compare() function so that the factor with the smallest 'next' field will be the largest.
trait Serializable
trait Product
trait Equals
trait Comparable[Factor]
class Object
trait Matchable
class Any