<...> indicates all the choices for each digit
For 3-digit number,<3, 4, 5> <1, 2, 3, 4, 5> <2, 4>
If 2 is the last digit, <3, 4, 5> <1, 3, 4, 5 minus 1 chosen for first digit> <2> therefore potential combos =
(3)(4-1)(1) = 9If 4 is the last digit, <3, 5> <1, 2, 3, 5 minus 1 chosen for first digit> <4> therefore potential combos =
(2)(4-1)(1) = 6For 4-digit number,<1, 2, 3, 4, 5 minus 1 chosen for last digit> <1, 2, 3, 4, 5 minus 2 chosen for first&last digit> <1, 2, 3, 4, 5 minus 3 chosen for first&2nd&last digit> <2, 4> therefor potential combos =
(5-1)(5-2)(5-3)(2) = 48
For 5-digit number,<1, 2, 3, 4, 5 minus 1 chosen for last digit> <1, 2, 3, 4, 5 minus 2 chosen for first&last digit> <1, 2, 3, 4, 5 minus 3 chosen for first&2nd&last digit> <1, 2, 3, 4, 5 minus 4 chosen for first&2nd&3rd&last digit> <2, 4> therefor potential combos =
(5-1)(5-2)(5-3)(5-4)(2) = 48Total combos = 9 + 6 + 48 + 48 = 111