import java.util.*;enum S{S;System z;int x,y;{for(Scanner s=new Scanner(z.in);(x=s.nextInt())>0;z.out.println(y*~y*(--y-3*x)/6+y/x))y=s.nextInt();}}