login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Remainder when n^n is divided by n!.
4

%I #16 May 09 2023 08:56:28

%S 0,0,0,3,16,5,576,2023,4096,227529,2656000,26301011,443667456,

%T 5268921853,294332416,820814907375,19909425135616,225992064764177,

%U 5838869363687424,43054524724611979,296380418621440000

%N Remainder when n^n is divided by n!.

%H Harry J. Smith, <a href="/A063709/b063709.txt">Table of n, a(n) for n=0..100</a>

%e a(7) = 2023 because 7^7 = 2023 (mod 7!).

%t Table[PowerMod[n, n, n! ], {n, 24}]

%o (PARI) for(n=0,22,print(Mod(n^n,n!)))

%o (PARI) { for (n=0, 100, write("b063709.txt", n, " ", n^n % n!) ) } \\ _Harry J. Smith_, Aug 28 2009

%Y Cf. A000142, A000312.

%K easy,nonn

%O 0,4

%A _Axel Harvey_, Aug 23 2001

%E Corrected and extended by a number of contributors, Aug 24 2001