For any $n\in\mathbb N$, denote by $a_n$ the sum $2+22+222+\cdots+22\ldots2$, where the last summand consists of $n$ digits of $2$. Determine the greatest $n$ for which $a_n$ contains exactly $222$ digits of $2$.
1. **Define the sequence \(a_n\)**:
   For any \(n \in \mathbb{N}\), \(a_n\) is defined as the sum \(2 + 22 + 222 + \cdots + \underbrace{22\ldots2}_{n \text{ digits}}\).

2. **Express \(a_n\) in a general form**:
   Each term in the sum can be written as \(2 \times \frac{10^k - 1}{9}\) for \(k = 1, 2, \ldots, n\). Therefore,
   \[
   a_n = 2 \left( \frac{10^1 - 1}{9} + \frac{10^2 - 1}{9} + \cdots + \frac{10^n - 1}{9} \right)
   \]
   Simplifying the sum inside the parentheses:
   \[
   a_n = \frac{2}{9} \left( (10^1 - 1) + (10^2 - 1) + \cdots + (10^n - 1) \right)
   \]
   \[
   a_n = \frac{2}{9} \left( 10 + 10^2 + \cdots + 10^n - n \right)
   \]
   \[
   a_n = \frac{2}{9} \left( \frac{10(10^n - 1)}{9} - n \right)
   \]
   \[
   a_n = \frac{2}{81} (10^{n+1} - 10 - 9n)
   \]
   \[
   a_n = \frac{2 \times 10^{n+1} - 20 - 18n}{81}
   \]

3. **Determine the number of digits of 2 in \(a_n\)**:
   We need to find the greatest \(n\) such that \(a_n\) contains exactly 222 digits of 2. To do this, we need to analyze the number of digits in \(a_n\).

4. **Approximate \(a_n\)**:
   \[
   a_n \approx \frac{2 \times 10^{n+1}}{81}
   \]
   Since \(\frac{2}{81} \approx 0.024691358\), we can approximate:
   \[
   a_n \approx 0.024691358 \times 10^{n+1}
   \]

5. **Count the digits**:
   The number of digits in \(a_n\) is approximately \(n+1 + \log_{10}(0.024691358)\). Since \(\log_{10}(0.024691358) \approx -1.6\), the number of digits is approximately \(n - 0.6\).

6. **Set up the equation**:
   We need \(n - 0.6 \approx 222\):
   \[
   n - 0.6 = 222
   \]
   \[
   n = 222 + 0.6
   \]
   \[
   n \approx 222.6
   \]

7. **Determine the greatest integer \(n\)**:
   Since \(n\) must be an integer, the greatest \(n\) is 222.

The final answer is \( \boxed{222} \)