title: Primality Test Set 1 Introduction And School Method 1
signature: primality_test_set_1_introduction_and_school_method_1 <- function(n) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(n, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(n), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          15L, 
          FALSE
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          90L, 
          FALSE
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          38L, 
          FALSE
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          65L, 
          FALSE
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          91L, 
          FALSE
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          16L, 
          FALSE
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          48L, 
          FALSE
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          74L, 
          FALSE
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          14L, 
          FALSE
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          47L, 
          TRUE
      )))
  
  }
  
  main()
source_py: def primality_test_set_1_introduction_and_school_method_1(n):
      if (n <= 1):
          return False
      if (n <= 3):
          return True
      if (((n % 2) == 0) or ((n % 3) == 0)):
          return False
      i = 5
      while ((i * i) <= n):
          if (((n % i) == 0) or ((n % (i + 2)) == 0)):
              return False
          i = (i + 6)
      return True
source_cpp: bool primality_test_set_1_introduction_and_school_method_1(int n) {
    if ( n <= 1 ) return false;
    if ( n <= 3 ) return true;
    if ( n % 2 == 0 || n % 3 == 0 ) return false;
    for ( int i = 5;
    i * i <= n;
    i = i + 6 ) if ( n % i == 0 || n % ( i + 2 ) == 0 ) return false;
    return true;
  }