Show solutionHide solution
We are given a function \(f\) with
\[f(x+y)=f(x)f(y)\quad\text{for all }x,y\in\mathbf N,\qquad f(1)=3.\]Step 1: Find a formula for \(f(x)\).
Taking \(y=1\) gives
\[f(x+1)=f(x)f(1)=3f(x).\]Thus each time \(x\) increases by \(1\), the value of \(f\) is multiplied by \(3\). Since \(f(1)=3\),
\[f(2)=3\cdot 3=3^2,\qquad f(3)=3\cdot 3^2=3^3,\]and in general
\[f(x)=3^x\quad\text{for every }x\in\mathbf N.\]This is consistent with the original rule, because \(3^{x+y}=3^x\cdot 3^y\).
Step 2: Write the given sum.
\[\sum_{x=1}^{n}f(x)=\sum_{x=1}^{n}3^x=3+3^2+3^3+\cdots+3^n.\]This is a geometric series with first term \(a=3\) and common ratio \(r=3\). Its sum is
\[S_n=3\cdot\frac{3^n-1}{3-1}=\frac{3(3^n-1)}{2}.\]Step 3: Solve for \(n\).
We are told that the sum equals \(120\):
\[\frac{3(3^n-1)}{2}=120.\]Multiplying both sides by \(2\):
\[3(3^n-1)=240,\]so
\[3^n-1=80,\qquad 3^n=81.\]Since \(81=3^4\), we get
\[n=4.\]Check: \(f(1)+f(2)+f(3)+f(4)=3+9+27+81=120\), as required.
Therefore, the value of \(n\) is
\[\boxed{4}.\]