Middle-Square Generator