Java Array Sum Square sumOfSquares(int numberOfTerms)

Here you can find the source of sumOfSquares(int numberOfTerms)

Description

sum Of Squares

License

Open Source License

Declaration

public static int sumOfSquares(int numberOfTerms) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static int sumOfSquares(int numberOfTerms) {
        return (int) (((double) numberOfTerms / 6) * (numberOfTerms + 1) * (2 * numberOfTerms + 1));
    }//  w  w w  .j a  va 2s . co  m
}

Related

  1. sumOfSquares(double[] vector)
  2. sumOfSquares(double[] vector)
  3. sumOfSquares(Number[] array)
  4. sumSq(double... values)
  5. sumSq(double[] a)
  6. sumSqual(byte[] b)