A208494 Least integer m>1 such that those k! mod m with k=1,...,n are pairwise distinct.
2, 2, 3, 7, 10, 13, 13, 13, 31, 37, 37, 37, 61, 61, 61, 83, 83, 83, 127, 127, 127, 127, 127, 179, 179, 179, 179, 179, 193, 193, 193, 193, 193, 193, 193, 193, 277, 277, 277, 277, 277, 277, 383, 383, 383, 383, 383, 479, 479, 479, 479, 479, 479, 479, 541, 541, 541, 541, 541, 541, 541, 541, 541, 641, 641, 641, 641, 641, 641, 641, 641, 641, 877, 877, 877, 877, 877, 877, 877, 877, 877, 877, 877, 877, 877, 877, 877, 877, 877, 877, 877, 877, 877, 877, 877, 877, 877, 877, 877, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013
Offset: 1
Examples
For n=5 we have a(5)=10 since 1!=1, 2!=2, 3!=6, 4!=24 and 5!=120 are pairwise incongruent mod 10 but not pairwise incongruent modulo any of 2,3,...,9.
Links
- Zhi-Wei Sun and Charles R Greathouse IV, Table of n, a(n) for n = 1..10000 (first 400 terms from Sun)
- Zhi-Wei Sun, A function taking only prime values, a message to Number Theory List, Feb 21 2012.
- Zhi-Wei Sun, On functions taking only prime values, J. Number Theory 133(2013), no.8, 2794-2812.
Programs
-
Mathematica
R[n_,i_]:=Union[Table[Mod[k!,i],{k,1,n}]] Do[Do[If[Length[R[n,i]]==n,Print[n," ",i];Goto[aa]],{i,2,Max[n^2,2]}]; Print[n];Label[aa];Continue,{n,1,1000}]
-
PARI
has(n,m)=my(t=1); #Set(vector(n,i,t=(t*i)%m))==n a(n,last=2)=while(!has(n,last), last++); last t=2;vector(100,n,t=a(n,t)) \\ Charles R Greathouse IV, Jul 31 2016
Comments