[algorithm.search_n] Fix search_n's complexity violation.

According to document, at most last - first applications of the corresponding predicate,
but (last - first) * count applications.
Merge pull request #56 from kariya-mitsuru/algorithm.search_n

[algorithm.search_n] Fix search_n's complexity violation.