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.

A258817 a(n) = (!0 + !1 +... + !(n-1)) mod n.

Original entry on oeis.org

0, 1, 2, 0, 3, 3, 0, 0, 8, 5, 4, 0, 9, 7, 8, 0, 13, 9, 4, 0, 14, 11, 14, 0, 3, 13, 17, 0, 25, 15, 4, 0, 26, 17, 28, 0, 30, 19, 35, 0, 4, 21, 9, 0, 8, 23, 32, 0, 7, 25, 47, 0, 30, 27, 48, 0, 23, 29, 45, 0, 48, 31, 35, 0, 48, 33, 12, 0, 14, 35, 7, 0, 34, 37, 53
Offset: 1

Views

Author

Michel Lagneau, Jun 11 2015

Keywords

Comments

!n is a subfactorial number (A000166).
Property of the sequence: a(1) = a(7) = 0 and a(4k) = 0 for k=1,2,...

Examples

			a(5)= 3 because !0 + !1 + !2 + !3 + !4 = 1 + 0 + 1 + 2 + 9 = 13 == 3 mod 5.
		

Crossrefs

Programs

  • Maple
    A:= proc(n) option remember; if n<=1 then 1-n else (n-1)*(procname(n-1)+procname(n-2)); fi; end;
    a:=n->n!*sum((-1)^k/k!, k=0..n):
    lf:=n->add(A(k), k=0..n-1);[seq(lf(n) mod n, n=1..40)];
  • Mathematica
    Table[Mod[Total[Subfactorial[Range[0, n-1]]], n], {n, Range[80]}]

Formula

a(n)= A173184(n) mod n.