quick search algo + prime numbers