A064546 Remainder when (n!)^2 is divided by n^n.
0, 0, 9, 64, 1900, 5184, 695310, 15089664, 346348629, 8189440000, 170553548176, 4519967588352, 202522159449675, 8500218417954816, 265594041953296875, 3543051899458551808, 454740628232312103872, 5853583711033675481088, 1445271811400044958489895, 91546885417441689600000000
Offset: 1
Keywords
Examples
a(5) = 1900 because (5!)^2 = 14400 = 1900 (mod 5^5 = 3125).
Links
- Harry J. Smith, Table of n, a(n) for n = 1..100
Programs
-
Mathematica
A064546[n_] := PowerMod[n!, 2, n^n]; Array[A064546, 20] (* Paolo Xausa, Aug 05 2025 *)
-
PARI
{ for (n=1, 100, write("b064546.txt", n, " ", (n!)^2 % n^n) ) } \\ Harry J. Smith, Sep 18 2009
Formula
a(n) = (n!)^2 mod n^n.