The conversation between human and AI assistant.
[|Human|] You are given a code, you need to suggest an improvement for its performance.
[|AI|] One possible improvement for this code's performance is to replace the loop with the mathematical formula for calculating the sum of an arithmetic series:

int n = 10;
int sum = (n*(n-1))/2;
[|Human|] 
You are given a code, you need to suggest an improvement for its performance.