Find sum of the series ? 3 + ? 12 + ... ... ... upto N terms | Java implementation of above approach ; Function to find the sum ; Apply AP formula ; Driver code ; number of terms
import java . io . * ; class GFG { static double findSum ( long n ) { return Math . sqrt ( 3 ) * ( n * ( n + 1 ) / 2 ) ; } public static void main ( String [ ] args ) { long n = 10 ; System . out . println ( findSum ( n ) ) ; } }