Problem

Source: 3rd National Women's Contest of Mexican Mathematics Olympiad 2024 , level 1+2 p8

Tags: primes, number theory



Find all positive integers \(n\) such that among the \(n\) numbers \[ 2n + 1, \, 2^2 n + 1, \, \ldots, \, 2^n n + 1 \] there are \(n\), \(n - 1\), or \(n - 2\) primes.