OFFSET
1,2
COMMENTS
The sequence lists the smallest nonnegative solutions z to the system of congruences z == 1 (mod p), z == 0 (mod v(p-1)), where p is a prime and v(p-1) = lcm(1,...,p-1).
LINKS
Umberto Cerruti, Il Teorema Cinese dei Resti (in Italian), 2015. The sequence is on page 21.
Eric Weisstein's World of Mathematics, Modular Inverse.
EXAMPLE
MAPLE
with(numtheory): P:=proc(q) local a, n; a:=[];
for n from 1 to q do a:=[op(a), n]; if isprime(n+1) then
print(lcm(op(a))*(lcm(op(a))^(-1) mod (n+1))); fi;
od; end: P(10^3); # Paolo P. Lava, Feb 16 2015
MATHEMATICA
r[k_] := LCM @@ Range[k]; u[k_] := PowerMod[r[k - 1], -1, k] r[k - 1]; Table[u[Prime[n]], {n, 1, 20}]
PROG
(Magma) [Modinv(Lcm([1..p-1]), p)*Lcm([1..p-1]): p in PrimesUpTo(60)];
(PARI) a099795(n) = lcm(vector(prime(n)-1, k, k));
a(n) = {my(m = a099795(n)); m*lift(1/Mod(m, prime(n))); } \\ Michel Marcus, Feb 13 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Bruno Berselli, Feb 12 2015 - proposed by Umberto Cerruti (Department of Mathematics "Giuseppe Peano", University of Turin, Italy)
STATUS
approved