Given expansion is $\left(2+\frac{x}{3}\right)^{n}$
Let $t_{r+1}$ be general term
Then , $t_{r+1} = ^nC_r\, 2^{n -r} \left(\frac{x}{3} \right)^r =\, ^nC_r \,2^{n-r} \cdot 3^{-r} x^r$
Since coefficients of $x^5$ and $x^6$ are equal
$ \therefore \:\:\:\: ^nC_6 \, 2^{n -6} \,3^{-6} =\, ^nC_5 \, 2^{n -5} \, 3^{-5}$
$\Rightarrow \frac{^{n}C_{6}}{^{n}C_{5}} =2\times3 \Rightarrow \frac{n! \times5!\times\left(n -5\right)!}{\left(n-6\right)! \times6!\times n!} =6$
$ \Rightarrow \frac{n-5}{6} =6 \Rightarrow n-5=36 \Rightarrow n=41$