Is there a general function or way in Java to calculate an equation of the form (a+b+...+n)^2 with a,b,n >= 0? : <p>I need to find a way to implement an algorithm in Java that can calculate (a+b+...+n)^2 with a,b,n >= 0. The purpose is to use it afterwards in order to calculate Jain's Fairness index for my algorithm in networks. Is there any standard way to do that or any specific library for advanced math that i might have missed?</p>
