Let $ a_1,a_2,...,a_k$ be positive integers not exceeding $ n$ such that $ a_i$ does not divide $ \prod\limits_{i\ne j}{a_j}$ for all $ i$. Denote by $ \pi(n)$ is the number of primes not exceeding $ n$. Prove that $ k\leq\pi(n).$
My attemp:
Let $ \pi(n)=r$ and The primes not exceeding $ n$ be $ \{p_1,p_2,...,p_r\}$. For each $ a_i$ let the exponent of $ p_j$ in its prime factorization be $ x_{ij}$. And let $ X$ be the corresponding $ k\times r$ matrix with entries $ x_{i,j}$ We are given that for each $ i$, $ \exists j=j(i)$ so that $ x_{ij}>\sum_{m=1}^kx_{mj}$.
Then I can't
As suggested, let $\pi(n) = r$ and let $\{p_1, \cdots, p_r\}$ denote the primes not exceeding $n$. For any prime $p$ and integer $k$, let $v_p (k)$ denote the largest power of $p$ dividing $k$. Then, we get a matrix of values $$\{v_{p_i} (a_j)\}_{1\le i \le r, 1\le j \le k}$$ and the condition implies that for each $1\le j \le k$, there exists some $1\le g(j) \le r$ such that $v_{p_{g(j)}} (a_j) > \sum_{m \neq j} v_{p_{g(j)}} (a_m)$. In particular, $v_{p_{g(j)}} (a_j) > v_{p_{g(j)}} (a_m)$ for all $m\neq j$.
If $k > \pi(n)$, then by the Pigeonhole Principle, there must be distinct indices $j_1$ and $j_2$ such that $g(j_1) = g(j_2)=:i$. But then both $v_{p_i} (a_{j_1}) > v_{p_i} (a_{j_2})$ and $v_{p_i} (a_{j_1}) < v_{p_i} (a_{j_2})$, contradiction.
We conclude $k \le \pi(n)$.