A212309 a(n) = n! mod 3^n.
0, 1, 2, 6, 24, 120, 720, 666, 954, 8586, 26811, 58725, 173259, 1189485, 3898206, 1077462, 17239392, 34789338, 238787595, 275338926, 2019994119, 578463687, 2265847911, 52114501953, 121029900948, 201452158890, 1848601693368, 4158660811014, 2058540433587, 36820880119062
Offset: 0
Links
- Seiichi Manyama, Table of n, a(n) for n = 0..1000
Programs
-
Mathematica
Table[Mod[n!,3^n],{n,0,30}] (* Harvey P. Dale, Apr 01 2018 *)
-
PARI
a(n) = n! % 3^n; \\ Michel Marcus, Jan 22 2021
-
Python
import math print([math.factorial(n)%(3**n) for n in range(99)])