Problem

Source: Problem 4, Brazilian MO 2015

Tags: number theory proposed, number theory



Let $n$ be a integer and let $n=d_1>d_2>\cdots>d_k=1$ its positive divisors. a) Prove that $$d_1-d_2+d_3-\cdots+(-1)^{k-1}d_k=n-1$$iff $n$ is prime or $n=4$. b) Determine the three positive integers such that $$d_1-d_2+d_3-...+(-1)^{k-1}d_k=n-4.$$