title: Primality Test Set 1 Introduction And School Method 1
signature: primalityTestSet1IntroductionAndSchoolMethod1 :: Integer -> Bool
  primalityTestSet1IntroductionAndSchoolMethod1 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 :: Bool -> Bool -> Bool
  validateSolution actual expected = do
      actual == expected
  
  
  driver :: Integer -> Bool -> String
  driver n expected = do
      if (validateSolution (PLACEHOLDER_FN_NAME n) expected)
          then "PASSED"
      else "FAILED"
  
  main = do
      printf "TEST-0...%s\n" (driver (15) (False) )
  
      printf "TEST-1...%s\n" (driver (90) (False) )
  
      printf "TEST-2...%s\n" (driver (38) (False) )
  
      printf "TEST-3...%s\n" (driver (65) (False) )
  
      printf "TEST-4...%s\n" (driver (91) (False) )
  
      printf "TEST-5...%s\n" (driver (16) (False) )
  
      printf "TEST-6...%s\n" (driver (48) (False) )
  
      printf "TEST-7...%s\n" (driver (74) (False) )
  
      printf "TEST-8...%s\n" (driver (14) (False) )
  
      printf "TEST-9...%s\n" (driver (47) (True) )
  
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;
  }