title: Sum Pairwise Products 2
signature: sumPairwiseProducts2 :: Integer -> Double
  sumPairwiseProducts2 n = 
test_code: import Text.Printf
  import Control.Exception (catch, SomeException)
  import Data.Typeable
  import qualified Data.List as List
  import qualified Data.Map as Map
  import qualified Data.Set as Set
  
  -- SOLUTION CODE
  -- ============================================
  
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  validateSolution :: Double -> Double -> Bool
  validateSolution actual expected = do
      (abs (actual-expected)) < 1e-09
  
  driver :: Integer -> Double -> String
  driver n expected = do
      if (validateSolution (PLACEHOLDER_FN_NAME n) expected)
          then "PASSED"
      else "FAILED"
  
  main = do
      printf "TEST-0...%s\n" (driver (57) (1397887.0) )
  
      printf "TEST-1...%s\n" (driver (18) (15675.0) )
  
      printf "TEST-2...%s\n" (driver (97) (11449977.0) )
  
      printf "TEST-3...%s\n" (driver (9) (1155.0) )
  
      printf "TEST-4...%s\n" (driver (42) (420497.0) )
  
      printf "TEST-5...%s\n" (driver (67) (2645897.0) )
  
      printf "TEST-6...%s\n" (driver (71) (3327486.0) )
  
      printf "TEST-7...%s\n" (driver (66) (2493271.0) )
  
      printf "TEST-8...%s\n" (driver (69) (2972060.0) )
  
      printf "TEST-9...%s\n" (driver (18) (15675.0) )
  
source_py: def sum_pairwise_products_2(n):
      return ((((n * (n + 1)) * (n + 2)) * ((3 * n) + 1)) / 24)
source_cpp: long long int sum_pairwise_products_2(int n) {
    return n * ( n + 1 ) * ( n + 2 ) * ( 3 * n + 1 ) / 24;
  }