Solve $3n^3 + 3n^2 + 4n = n^n$ in positive integers

So my cousin is in the math team (7th grade) and he was asking me for help on one of his problems but I don't know how to solve

For what positive integer n does $3n^3 + 3n^2 + 4n = n^n$

anyone know how to do this?


This is the solution I mentioned in the comments and was encouraged to put as a full post:

Factor $n$ out of the equation and rearrange to get $$ 4 = n(n^{n-2} - 3n - 3). $$ This is a factorization of $4$ into positive integers. The only positive integer factors of $4$ are $1,2$ and $4$, but $n=1$ and $n=2$ don't work, so $n=4$.


From an algebraic pont of view, you could consider the function: $$f(x)=3x^3 + 3x^2 + 4x- x^x$$ and notice that $f(0)=-1$, $f(1)=9$, $f(2)=40$, $f(3)=93$, $f(4)=0$. For $x \gt 4$, the term $x^x$ is very predominant and $f(x)$ decreases from $0$ to $-\infty$.

So, in the integer domain, there is only one solution which is $n=4$. For real solutions, there is another root between $0$ and $1$ (in fact $x=0.162884$).


I would also try the general approach, draw both functions f(x) and g(x) with some graph software (like graph :-) ) and then check the solutions by inserting them into the equations. If the equation is rewritten like the user @user139388 did,then you can see the only positive integer solution is 4.

(I know that the general approach is to advanced for 7th grade,but it tells you what other possible solutions are and nowadays kids have no problems with the use of computers and simple computer programs like graph etc :-)) (below the graph there is a re-arranged equation and one can se that the only positive INTEGER solution is n=4)

enter image description here

enter image description here