Update EquationSolver.java

Made nextNomial function