private static long sum(long n){
  return n * (n + 1) / 2l;
}

private static long sum ( long n ) { return n * ( n + 1 ) / 2l ; }
returns the sum of the number from 1 . . n according to gauss ' summation formula : \ [ \ sum \ limits_ { k = 1 } ^ n k = \ frac { n ( n + 1 ) } { 2 } \ ]
