delay(n*(n/10)); is robuster against overflow
but for values of n less than 10 it will "underflow". E.g. n=9 will give delay(0);
Since delay takes a long integer, the best thing to do is force the calculation (assuming that n is an integer):
delay( ((long)n)*n/10);
Pete