This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A055976 #14 Feb 19 2024 10:28:12 %S A055976 0,0,0,3,0,1,0,1,1,1,0,1,0,1,1,1,0,1,0,1,1,1,0,1,1,1,1,1,0,1,0,1,1,1, %T A055976 1,1,0,1,1,1,0,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,0,1,1,1,1,1,0,1, %U A055976 1,1,0,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1 %N A055976 Remainder when (n-1)! + 1 is divided by n. %C A055976 Related to Wilson's theorem. a(n) = 0 iff n = 1 or a prime; a(n) = 1 iff n > 4 is composite; a(n) = 3 iff n = 4. %D A055976 Albert H. Beiler, Recreations in The Theory of Numbers, The Queen of Mathematics Entertains, Second Edition, Dover Publications, Inc., New York, 1966, Page 50. %H A055976 Antti Karttunen, <a href="/A055976/b055976.txt">Table of n, a(n) for n = 1..10000</a> %t A055976 Do[Print[Mod[(n-1)!+1, n]], {n, 1, 100}] %o A055976 (PARI) A055976(n) = (((n-1)!+1)%n); \\ _Antti Karttunen_, Aug 27 2017 %Y A055976 Cf. A061007. %K A055976 easy,nonn %O A055976 1,4 %A A055976 _Robert G. Wilson v_, Jul 23 2000