OFFSET
1,2
LINKS
Matthew Campbell and Charles R Greathouse IV, Table of n, a(n) for n = 1..10000 (first 724 terms from Campbell)
EXAMPLE
a(2) = superfactorial(2) mod 3 = (2!*1!) mod 3 = 2 mod 3 = 2.
MAPLE
a:= proc(n) option remember; local i, p, r, v;
p, r, v:= ithprime(n), 1$2;
for i from 2 to p-1 do
v:= v*i mod p; r:= r*v mod p
od; r
end:
seq(a(n), n=1..100); # Alois P. Heinz, Aug 05 2015
MATHEMATICA
Table[Mod[Superfactorial[Prime[n] - 1], Prime[n]], {n, 1, 175}]
PROG
(PARI) a(n, p=prime(n))=my(t=Mod(1, p)); lift(prod(k=2, p-1, t*=k)) \\ Charles R Greathouse IV, Aug 05 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Matthew Campbell, Aug 05 2015
STATUS
approved