注意sum(i-1)+i*i*i时,(long)i*i*i
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
long sum[] = new long [100001];
for (int i = 1; i < sum.length; i++) {
if (i%3==0) {
sum[i] = sum[i-1]+(long)i*i*i;
}else{
sum[i] = sum[i-1]+(long)i;
}
}
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
int n = sc.nextInt();
if (n<0) {
break;
}
System.out.println(sum[n]);
}
sc.close();
}
}