login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A056051 a(n) = (n-2)! - 1 (mod n). 2
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 (list; graph; refs; listen; history; text; internal format)
OFFSET

2,1

COMMENTS

(n-2)! - 1 is congruent to 0 iff n is a prime and is congruent to -1 iff n is a composite > 4.

LINKS

Antti Karttunen, Table of n, a(n) for n = 2..10000

MATHEMATICA

Do[m = Mod[(n - 2)! - 1, n]; If[m < 2, Print[m], Print[m - n]], {n, 2, 100}]

PROG

(PARI) A056051(n) = { my(m=(((n-2)!-1)%n)); if(m < 2, m, m-n); }; \\ Antti Karttunen, Sep 14 2017, after Mathematica-code.

CROSSREFS

Cf. A005171.

Sequence in context: A178226 A288622 A095907 * A143541 A344120 A090173

Adjacent sequences:  A056048 A056049 A056050 * A056052 A056053 A056054

KEYWORD

easy,sign

AUTHOR

Robert G. Wilson v, Jul 25 2000

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 16 08:14 EDT 2021. Contains 347469 sequences. (Running on oeis4.)