The length of a square is p inches. The width of a rectangle is also p inches. The perimeter of a rectangle is 10 inches more than the perimeter of the square. The rectangle has a perimeter of b inches. Write an equation relating p and b.