Generate a Python program that has the following intention:

The program defines a function p1 that takes two arguments: an array arr and a value x. The purpose of the function is to find the index of the element in the array that is equal to the value x.

The function p1 uses a nested function p2 to perform the search. The p2 function takes two arguments: start and end, which represent the starting and ending indices of a subarray in the main array arr.

The p2 function uses a binary search algorithm to find the index of the element in the subarray that is equal to the value x. If the subarray has only one element, the function returns the index of that element. If the element is not found in the subarray, the function recursively searches the subarrays to the left and right of the current subarray.

The p1 function calls the p2 function with the starting and ending indices of the main array, and returns the index returned by the p2 function.

Overall, the program is a implementation of a binary search algorithm that can be used to find an element in an array. Provide your reponse without using the word index.
user