Given that P = { x: 0 ≤ x ≤ 36, x is a factor of 36…