multiplicity function edited , now returns inifinity when n equals 0, and also returns infinty when p equals 2 and n equals zero, which previously was returning zero 

for issues #8159 and #8145
The code returns a value error if p is less than two, so if this line is moved up, then it would return infinity even when p is less than 2 and n is 0. By definition I meant the function multiplicity