Find all possible values of a natural number $n$ such that $a! + b! = 5^n$

note: for $a\geq5$ and $b\geq5$ the last digits of $a!$ and $b!$ will be $0$ , giving the last digit of $a!+b!$ as $0$ . But , this will contradict that $a!+b!=5^n$ as $5^n$ have last digit as $5$ .

Hence $a<5$ and $b<5$ i.e. $(a,b)\in\{(1,1) , (2,2) , (3,3),(4,4),(1,2),(1,3),\color{red}{(1,4)},(2,1),(2,3),(2,4),(3,4)\}$ .

Among these only $(a,b)=(1,4)$ or $(4,1)$ satisfys the condition . $$1!+4!=5^2$$


Wlog $a\le b$ so, working modulo $2$, $a\le1$ and $a!=1$. Then $5\nmid b!$ and $b\le4$. We can easily check the only solution is $b=4$, so $n=2$.