rules for patterns in math - Search