A056051 a(n) = (n-2)! - 1 (mod n).
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, -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, 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
Offset: 2
Links
- Antti Karttunen, Table of n, a(n) for n = 2..10000
Crossrefs
Cf. A005171.
Programs
-
Mathematica
Do[m = Mod[(n - 2)! - 1, n]; If[m < 2, Print[m], Print[m - n]], {n, 2, 100}]
-
PARI
A056051(n) = { my(m=(((n-2)!-1)%n)); if(m < 2,m,m-n); }; \\ Antti Karttunen, Sep 14 2017, after Mathematica-code.
Comments