Generate a Python program that has the following intention:

The program is a binary search algorithm that is implemented using recursion. The intention of the program is to find the index of an element in an array in O(log n) time. The binary search algorithm works by dividing the search space in half and repeatedly comparing the middle element with the target element until it is found or until the search space is reduced to one element.

The function p2 is the recursive implementation of the binary search algorithm. It takes two arguments: start and end, which represent the start and end indices of the search space. The function p1 is the outer function that calls p2 with the entire array and the target element as arguments.

The program works by calling p1 with the array and the target element as arguments. p1 then calls p2 with start and end set to 0 and len(arr), respectively. p2 then computes the midpoint of the search space and compares the middle element with the target element. If the middle element is equal to the target element, it returns the index of the middle element. If the middle element is less than the target element, it recursively calls p2 with start and mid as arguments. If the middle element is greater than the target element, it recursively calls p2 with mid + 1 and end as arguments. This process continues until the search space is reduced to one element or until the target element is found. The final index returned by the recursive calls is then returned by p1. Your response should contain 700+ words.
user