Problem Solving by Finding a Pattern