title: Count Number Pairs N B N Gcd B B
signature: countNumberPairsNBNGcdBB :: Integer -> Double
  countNumberPairsNBNGcdBB 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 (17) (58.47239288489289) )
  
      printf "TEST-1...%s\n" (driver (72) (349.9783310569835) )
  
      printf "TEST-2...%s\n" (driver (43) (187.0499406858786) )
  
      printf "TEST-3...%s\n" (driver (55) (252.6486716559348) )
  
      printf "TEST-4...%s\n" (driver (62) (291.1683590456309) )
  
      printf "TEST-5...%s\n" (driver (22) (81.19789150478006) )
  
      printf "TEST-6...%s\n" (driver (17) (58.47239288489289) )
  
      printf "TEST-7...%s\n" (driver (68) (326.67596370158344) )
  
      printf "TEST-8...%s\n" (driver (20) (71.95479314287363) )
  
      printf "TEST-9...%s\n" (driver (29) (114.88796013002468) )
  
source_py: def count_number_pairs_n_b_n_gcd_b_b(n):
      k = n
      imin = 1
      ans = 0
      while (imin <= n):
          imax = (n / k)
          ans += (k * ((imax - imin) + 1))
          imin = (imax + 1)
          k = (n / imin)
      return ans
source_cpp: int count_number_pairs_n_b_n_gcd_b_b(int n) {
    int k = n;
    int imin = 1;
    int ans = 0;
    while ( imin <= n ) {
      int imax = n / k;
      ans += k * ( imax - imin + 1 );
      imin = imax + 1;
      k = n / imin;
    }
    return ans;
  }