title: Finding Power Prime Number P N
signature: finding_power_prime_number_p_n <- function(n, p) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      abs(actual - expected) < 1e-09
  }
  
  driver <- function(n, p, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(n, p), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          49L, 30L, 
          1.6333333333333333
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          80L, 25L, 
          3.2
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          10L, 9L, 
          1.1111111111111112
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          81L, 57L, 
          1.4210526315789473
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          11L, 4L, 
          2.75
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          45L, 34L, 
          1.3235294117647058
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          86L, 90L, 
          0.0
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          27L, 78L, 
          0.0
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          80L, 60L, 
          1.3333333333333333
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          97L, 31L, 
          3.129032258064516
      )))
  
  }
  
  main()
source_py: def finding_power_prime_number_p_n(n, p):
      ans = 0
      temp = p
      while (temp <= n):
          ans += (n / temp)
          temp = (temp * p)
      return ans
source_cpp: int finding_power_prime_number_p_n(int n, int p) {
    int ans = 0;
    int temp = p;
    while ( temp <= n ) {
      ans += n / temp;
      temp = temp * p;
    }
    return ans;
  }