Generate a Python program that has the following intention:

The program defines a function p1 that takes in two integers a and b and calculates the greatest common divisor (GCD) of a and b. The GCD is the largest integer that divides evenly into both a and b.

The function uses the Euclidean algorithm to calculate the GCD. The Euclidean algorithm states that to find the GCD of two numbers a and b, you can repeatedly apply the following process until one of the numbers becomes 0:

1. If b is 0, then the GCD is a.
2. If b is not 0, then the GCD is the GCD of the remainder of a divided by b and b.
The p1 function implements this process by recursively calling itself with the remainder of a divided by b and b. The if statement ensures that the function only recurses when b is not 0. Finally, the return statement returns the GCD.

The intention of the program is to implement an efficient way to calculate the GCD of two integers using the Euclidean algorithm. This can be useful in many applications, such as in number theory, cryptography, and computer graphics.