Question 27
Determine all sequences $a_{1}, a_{2}, \ldots$ of positive integers such that, for any pair of positive integers $m \leq n$, the arithmetic and geometric means
$$ \frac{a_{m}+a_{m+1}+\cdots+a_{n}}{n-m+1}\quad \text{and}\quad(a_{m}a_{m+1}\cdots a_{n})^{\frac{1}{n-m+1}} $$
are both integers.
$$ \frac{a_{m}+a_{m+1}+\cdots+a_{n}}{n-m+1}\quad \text{and}\quad(a_{m}a_{m+1}\cdots a_{n})^{\frac{1}{n-m+1}} $$
are both integers.