OFFSET
1,3
LINKS
Robert Israel, Table of n, a(n) for n = 1..413
EXAMPLE
Prime(6) = 13, 13 mod 2 = 1, 13 mod 3 = 1, 13 mod 5 = 3, 13 mod 7 = 6, 13 mod 11 = 2 so a(6) = 1*1*3*6*2 = 36.
MAPLE
f:= proc(n) local p, i;
p:= ithprime(n);
mul(p mod ithprime(i), i=1..n-1)
end proc:
map(f, [$1..25]); # Robert Israel, Jan 12 2021
MATHEMATICA
f[n_] := Times @@ Mod[ Prime[n], Table[ Prime[i], {i, n - 1}]]; Table[ f[n], {n, 22}] (* Robert G. Wilson v, Feb 04 2005 *)
Join[{0}, Table[Times@@Mod[Prime[n], Prime[Range[n-1]]], {n, 2, 30}]] (* Harvey P. Dale, May 16 2019 *)
PROG
(PARI) a(n) = my(pr = 1, pn = prime(n)); forprime (q=1, precprime(pn-1), pr *= (pn % q)); pr; \\ Michel Marcus, Jan 12 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Hans Boelens (h.p.m.boelens(AT)pl.hanze.nl), Feb 02 2005
EXTENSIONS
More terms from Robert G. Wilson v, Feb 04 2005
a(1) (an empty product, therefore 1 by standard convention) corrected by N. J. A. Sloane, Jan 11 2021
STATUS
approved