cp's OEIS Frontend

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.

A055976 Remainder when (n-1)! + 1 is divided by n.

Original entry on oeis.org

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, 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, 1, 1, 1, 0, 1, 1, 1
Offset: 1

Views

Author

Robert G. Wilson v, Jul 23 2000

Keywords

Comments

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.

References

  • Albert H. Beiler, Recreations in The Theory of Numbers, The Queen of Mathematics Entertains, Second Edition, Dover Publications, Inc., New York, 1966, Page 50.

Crossrefs

Cf. A061007.

Programs

  • Mathematica
    Do[Print[Mod[(n-1)!+1, n]], {n, 1, 100}]
  • PARI
    A055976(n) = (((n-1)!+1)%n); \\ Antti Karttunen, Aug 27 2017