Fibonacci O(log(n)) version
Number of pervert pairs in an array