Each person gets 3/n gallons of ice cream.
You are dividing 3 gallons of ice cream into n servings - an equal amount for person.
For example if there were 6 people, then n = 6. 3/6 = 1/2. Each person gets 1/2 a gallon of ice cream. 1/2 + 1/2 + 1/2 + 1/2 + 1/2 + 1/2 = 3, so the 3 gallons are divided evenly