Problem

Source: 2024 Swiss MO/1

Tags: number theory, prime numbers



If $a$ and $b$ are positive integers, we say that $a$ almost divides $b$ if $a$ divides at least one of $b - 1$ and $b + 1$. We call a positive integer $n$ almost prime if the following holds: for any positive integers $a, b$ such that $n$ almost divides $ab$, we have that $n$ almost divides at least one of $a$ and $b$. Determine all almost prime numbers.

HIDE: original link https://mathematical.olympiad.ch/fileadmin/user_upload/Archiv/Intranet/Olympiads/Mathematics/deploy/exams/2024/FinalRound/Exam/englishFinalRound2024.pdf!!