work = int(input()) days = int(input()) for i in range(days, 1, -1): work= work - (work // (i ** 2)) print(work)