To find the number of years \( n \) when the number of students reached 365, we start with the equation:
\[ 240(1.15)^n = 365 \]
First, divide both sides by 240:
\[ (1.15)^n = \frac{365}{240} \]
Calculate the right side:
\[ \frac{365}{240} \approx 1.5208333 \]
Now, we have:
\[ (1.15)^n \approx 1.5208333 \]
To solve for \( n \), we can take the logarithm of both sides. Using base 10 logarithm:
\[ \log((1.15)^n) = \log(1.5208333) \]
Using the logarithmic identity \( \log(a^b) = b \cdot \log(a) \):
\[ n \cdot \log(1.15) = \log(1.5208333) \]
Now, solve for \( n \):
\[ n = \frac{\log(1.5208333)}{\log(1.15)} \]
Calculating the logarithms (using a calculator):
\[ \log(1.5208333) \approx 0.181 \]
\[ \log(1.15) \approx 0.0614 \]
So, we have:
\[ n \approx \frac{0.181}{0.0614} \approx 2.95 \]
Since \( n \) represents the number of years and must be a whole number, we round \( 2.95 \) to the nearest whole number:
\[ n \approx 3 \]
Therefore, the number of years it took for the number of students to reach 365 is approximately 3 years.