Write an algorithm to find a specific mathematical pattern or sequence within a given array of numbers.