OFFSET
2,2
COMMENTS
a(n) gives also the smallest coefficient for which the multiple M of lcm(1 through p(n)-1) satisfies p(n) divides M + 1. This computes the solution of the puzzle requiring the smallest number such that grouping in 2's, 3's, etc. up to the n-th prime,all leave a remainder of one except the last which leaves no remainder.
EXAMPLE
a(2)=1 because prime(2)=3 and floor(3!/lcm(1,2,3)) mod 3 = 1 mod 3 = 1;
a(3)=2 because prime(3)=5 and floor(5!/lcm(1,2,3,4,5)) mod 5 = 2 mod 5 = 2;
a(4)=5 because prime(4)=7 and floor(7!/lcm(1,2,3,4,5,6,7)) mod 7 = 12 mod 7 = 5;
a(7)=10 because prime(7)=17 and floor(17!/lcm(1,2,...,17)) mod 17 = 29030400 mod 17 = 10.
MAPLE
for n from 2 to 150 do printf(`%d, `, floor(ithprime(n)!/ilcm(i $ i=1..ithprime(n))) mod ithprime(n) ); od:
PROG
(Magma) [Floor( Factorial(p)/Lcm([1..p]) ) mod p: p in PrimesInInterval(3, 400)]; // Bruno Berselli, Feb 08 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Lekraj Beedassy, Mar 13 2001
EXTENSIONS
More terms from James A. Sellers, Mar 15 2001
STATUS
approved