The OEIS is supported by the many generous donors to the OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A247190 Calculate the smallest positive residues of 2!,3!,...,(prime(n)-1)! modulo prime(n) and stop the calculation at the moment m when for the first time there appear two equal numbers. If m!==k!, then a(n)=k; but a(n)=0 if no such m exists. 5
 0, 3, 2, 4, 3, 3, 4, 4, 2, 6, 5, 8, 4, 2, 2, 8, 5, 7, 4, 9, 3, 8, 15, 2, 14, 2, 9, 2, 7, 10, 3, 4, 10, 13, 13, 11, 2, 10, 17, 12, 3, 27, 3, 7, 31, 19, 10, 2, 21, 14, 8, 2, 14, 11, 7, 15, 17, 14, 8, 17, 3, 14, 4, 10, 20, 7, 2, 24, 2, 2, 10, 5, 18, 44, 21, 36 (list; graph; refs; listen; history; text; internal format)
 OFFSET 3,2 COMMENTS Erdős asked whether there are any primes p > 5 for which the numbers 2!, 3!,..., (p-1)! are all distinct mod p. According to [Trudgian], for n in the interval [4, pi(10^9)], we have a(n)>0. There is a conjecture that answer to the Erdős question is no, which is equivalent to having a(n)>0 for n>=4. LINKS Peter J. C. Moses and Chai Wah Wu, Table of n, a(n) for n = 3..10002 First 1000 terms from Peter J. C. Moses. Vladica Andrejic, Alin Bostan, Milos Tatarevic, Improved algorithms for left factorial residues, arXiv:1904.09196 [math.NT], 2019. B. Rokowska and A. Schinzel, Sur un problème de M. Erdős, Elem. Math., 15:84-85, 1960, MR117188 (22 #7970). T. Trudgian, There are no socialist primes less than 10^9, arXiv:1310.6403 [math.NT], 2013. T. Trudgian, There are no socialist primes less than 10^9, INTEGERS, 14 (2014), A63. FORMULA If, for n>=4, a(n)=0, then prime(n)==5 (mod 8) and (5/prime(n))=1, (-23/prime(n))=1 [Rokowska and Schinzel]; (1957/prime(n))=1 or (1957/prime(n))=-1 & ((4*y+25)/prime(n))=-1 for all y satisfying y*(y+4)*(y+6)==1 (mod prime(n)[Trudgian]. EXAMPLE Let n=5, prime(n)=11. Then modulo 11 we have 2!==2, 3!==6, 4!==2. Since 4!==2!, then, by the definition, m=4,k=2. So a(5)=2. Let n=7, prime(n)=17. Then modulo 17 we have 2!==2, 3!==6, 4!==7, 5!==1, 6!==6. Since 6!==3!, then, by the definition, m=6,k=3. So a(7)=3. MATHEMATICA Table[A247190={}; NestWhile[#+1&, 2, (AppendTo[A247190, Mod[#!, Prime[n]]]; Max[Last[Transpose[Tally[A247190]]]]<=1)&]-1; If[#>n, -1, #]&[Position[A247190, Last[A247190], 1, 1][[1]][[1]]]+1, {n, 3, 100}] (* Peter J. C. Moses, Nov 23 2014 *) PROG (Python) from sympy import prime def A247190(n): ....p, f, fv = prime(n), 1, {} ....for i in range(2, p): ........f = (f*i) % p ........if f in fv: ............return fv[f] ........else: ............fv[f] = i ....else: ........return 0 # Chai Wah Wu, Nov 25 2014 CROSSREFS Cf. A000040. Sequence in context: A025509 A130079 A350929 * A243289 A134559 A333773 Adjacent sequences: A247187 A247188 A247189 * A247191 A247192 A247193 KEYWORD nonn AUTHOR Vladimir Shevelev, Nov 23 2014 EXTENSIONS More terms from Peter J. C. Moses, Nov 23 2014 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified March 29 22:15 EDT 2023. Contains 361599 sequences. (Running on oeis4.)