src/main/java/be/hctel/renaissance/hideandseek/nongame/utils/AdvancedMath.java
public static int arithmeticSum(int d, int a1, int n) {
		int an = a1+d*(n-1);
		int out = ((a1+an)*n)/2;
		return out;
	}
/**
	 * Calculates the sum of an arithmetical series
	 * @param d the common difference
	 * @param a1 First number of serie
	 * @param n last term index
	 * @return the sum of an arithmetical series
	 */
Calculates the sum of an arithmetical series
@param d the common difference
@param a1 First number of serie
@param n last term index
@return the sum of an arithmetical series
Calculates the sum of an arithmetical series @param d the common difference @param a1 First number of serie @param n last term index @return the sum of an arithmetical series
public static int arithmeticSum(int d, int a1, int n) {
		int an = a1+d*(n-1);
		int out = ((a1+an)*n)/2;
		return out;
	}
public static int arithmeticSum ( int d , int a1 , int n ) { int an = a1 + d * ( n - 1 ) ; int out = ( ( a1 + an ) * n ) / 2 ; return out ; }
Calculates the sum of an arithmetical series
 @param d the common difference
 @param a1 First number of serie
 @param n last term index
 @return the sum of an arithmetical series
Calculates the sum of an arithmetical series @param d the common difference @param a1 First number of serie @param n last term index @return the sum of an arithmetical series