title: Eulers Criterion Check If Square Root Under Modulo P Exists
signature: eulersCriterionCheckIfSquareRootUnderModuloPExists :: Integer -> Integer -> Bool
  eulersCriterionCheckIfSquareRootUnderModuloPExists n p = 
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 -> Integer -> Bool -> String
  driver n p expected = do
      if (validateSolution (PLACEHOLDER_FN_NAME n p) expected)
          then "PASSED"
      else "FAILED"
  
  main = do
      printf "TEST-0...%s\n" (driver (71) (78) (False) )
  
      printf "TEST-1...%s\n" (driver (85) (75) (False) )
  
      printf "TEST-2...%s\n" (driver (4) (35) (True) )
  
      printf "TEST-3...%s\n" (driver (20) (99) (False) )
  
      printf "TEST-4...%s\n" (driver (71) (29) (True) )
  
      printf "TEST-5...%s\n" (driver (72) (88) (False) )
  
      printf "TEST-6...%s\n" (driver (36) (54) (True) )
  
      printf "TEST-7...%s\n" (driver (95) (52) (False) )
  
      printf "TEST-8...%s\n" (driver (83) (33) (False) )
  
      printf "TEST-9...%s\n" (driver (72) (13) (False) )
  
source_py: def eulers_criterion_check_if_square_root_under_modulo_p_exists(n, p):
      n = (n % p)
      for x in range(2, p, 1):
          if (((x * x) % p) == n):
              return True
      return False
source_cpp: bool eulers_criterion_check_if_square_root_under_modulo_p_exists(int n, int p) {
    n = n % p;
    for ( int x = 2;
    x < p;
    x ++ ) if ( ( x * x ) % p == n ) return true;
    return false;
  }