A set \( S \) of two or more positive integers is called almost closed under addition if the sum of any two distinct elements of \( S \) also belongs to \( S \). Let \( P(x) \) be a polynomial with integer coefficients for which there exists an almost closed under addition set \( S \), such that for any two distinct \( a \) and \( b \) from \( S \), the numbers \( P(a) \) and \( P(b) \) are coprime. Prove that \( P \) is a constant.
Problem
Source: XIII International Festival of Young Mathematicians Sozopol 2024, Theme for 10-12 grade
Tags: number theory