On the Erd˝os–Fuchs theorem