Generate a Python program that has the following intention:

The intention of the program is to find all the prime factors of a given number. The function p1(n) takes an integer n as input and returns a list of all the prime factors of n.

The function first checks if the input n is equal to 1. If it is, it returns an empty list, as 1 is neither prime nor has any factors.

Otherwise, it starts from i = 2 and iterates until i is less than or equal to the square root of n (rounded up to the nearest integer). This is done because all the prime factors of a number n must be less than or equal to the square root of n.

For each i, if n is evenly divisible by i (i.e., n % i == 0), it means that i is a factor of n and the function recursively calls itself with n // i (the remainder of n divided by i). The list of factors found by the recursive call is then appended to the current list of factors.

If the number of iterations is equal to the square root of n (or more precisely, if i is equal to or greater than the square root of n plus 1), it means that all the factors of n have been found. In this case, the function returns a list containing only n as the last element of the list.

Overall, the function uses a combination of brute-force search and recursion to find all the prime factors of a given number. It is not the most efficient algorithm, but it is a simple and easy to understand implementation.