koteitan is a user on googoldon.net. You can follow them or interact with them if you have an account anywhere in the fediverse. If you don't, you can sign up here.

$f(n)=\frac{n^{n+2}-2n^{n+1}+n}{(n-1)^2}\\ =\frac{n^n((n-1)^2+(n-1))}{(n-1)^2}\\ =n^n\left(1-\frac{1}{n-1}\right)\\ =n^n\left(\frac{n-1-1}{n-1}\right)\\ =n^n\left(\frac{n-2}{n-1}\right)\\$

koteitan @koteitan

$f(n)=\frac{n^{n+2}-2n^{n+1}+n}{(n-1)^2}\\ =\frac{n^n(n^2-2n)+n}{(n-1)^2}\\ =\frac{n^n(n^2-2n+1)-n^n+n}{(n-1)^2}\\ =\frac{n^n(n-1)^2+(n-n^n)}{(n-1)^2}\\ =n^n+\frac{n-n^n}{(n-1)^2}\\$