This function is used for calculating the g-index

The definition of g-index is : putting a researcher's article in a
descending way by citation, the first g articles has the total citation
which is at least equal to g^2.