title: Count Number Pairs N B N Gcd B B
signature: count_number_pairs_n_b_n_gcd_b_b <- function(n) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      abs(actual - expected) < 1e-09
  }
  
  driver <- function(n, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(n), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          17L, 
          58.47239288489289
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          72L, 
          349.9783310569835
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          43L, 
          187.0499406858786
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          55L, 
          252.6486716559348
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          62L, 
          291.1683590456309
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          22L, 
          81.19789150478006
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          17L, 
          58.47239288489289
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          68L, 
          326.67596370158344
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          20L, 
          71.95479314287363
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          29L, 
          114.88796013002468
      )))
  
  }
  
  main()
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;
  }