def get_n_primes_near_x(number, target):
 if ((target == 1) and (number == 1)):
  return [1]
 primes = []
 i = (target - 1)
 if ((i % 2) == 0):
  i -= 1
 while ((len(primes) != number) and (i > 0)):
  if is_prime(i):
   primes.append(int(i))
  i -= 2
 if (len(primes) != number):
  raise RuntimeError(('unable to find %d prime numbers < %d' % (number, target)))
 return primes

def get_n_primes_near_x ( number , target ) : if ( ( target == 1 ) and ( number == 1 ) ) : return [ 1 ] primes = [ ] i = ( target - 1 ) if ( ( i % 2 ) == 0 ) : i -= 1 while ( ( len ( primes ) != number ) and ( i > 0 ) ) : if is_prime ( i ) : primes . append ( int ( i ) ) i -= 2 if ( len ( primes ) != number ) : raise RuntimeError ( ( 'unable to find %d prime numbers < %d' % ( number , target ) ) ) return primes
backward-find primes smaller than target .