A118169 Minimum values of abs(n^n-x!) for given n.
0, 0, 2, 3, 136, 1915, 6336, 460663, 13148416, 91581111, 3772979200, 198133379411, 7608426080256, 52812321503747, 4709633119830016, 316248789972027375, 16013842065532911616, 296760465891270915823, 13494391336411560935424
Offset: 0
Examples
3^3 = 27, the closest x! can get to 27 is 4! = 24, so a(3) = 3^3 - 4! = 3
Programs
-
Mathematica
Join[{0,0},With[{fc=Range[200]!},Drop[Flatten[Table[Abs[n^n-Nearest[ fc,n^n]],{n,18}]],2]]] (* Harvey P. Dale, Jan 02 2016 *)