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 A056051 #8 Sep 14 2017 09:29:13 %S A056051 0,0,1,0,-1,0,-1,-1,-1,0,-1,0,-1,-1,-1,0,-1,0,-1,-1,-1,0,-1,-1,-1,-1, %T A056051 -1,0,-1,0,-1,-1,-1,-1,-1,0,-1,-1,-1,0,-1,0,-1,-1,-1,0,-1,-1,-1,-1,-1, %U A056051 0,-1,-1,-1,-1,-1,0,-1,0,-1,-1,-1,-1,-1,0,-1,-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 %N A056051 a(n) = (n-2)! - 1 (mod n). %C A056051 (n-2)! - 1 is congruent to 0 iff n is a prime and is congruent to -1 iff n is a composite > 4. %H A056051 Antti Karttunen, <a href="/A056051/b056051.txt">Table of n, a(n) for n = 2..10000</a> %t A056051 Do[m = Mod[(n - 2)! - 1, n]; If[m < 2, Print[m], Print[m - n]], {n, 2, 100}] %o A056051 (PARI) A056051(n) = { my(m=(((n-2)!-1)%n)); if(m < 2,m,m-n); }; \\ _Antti Karttunen_, Sep 14 2017, after Mathematica-code. %Y A056051 Cf. A005171. %K A056051 easy,sign %O A056051 2,1 %A A056051 _Robert G. Wilson v_, Jul 25 2000