

A245085


Maximal t in [2, prime(n)1] such that all the smallest positive residues of 2!,3!,...,t! modulo prime(n) are distinct.


2



4, 5, 3, 8, 5, 4, 7, 5, 9, 12, 6, 10, 9, 11, 4, 15, 7, 8, 7, 13, 18, 9, 18, 13, 17, 9, 10, 10, 23, 11, 11, 18, 17, 17, 18, 21, 15, 14, 28, 13, 26, 36, 8, 13, 32, 22, 16, 6, 24, 15, 22, 28, 21, 15, 28, 16, 42, 23, 32, 25, 8, 20, 18, 20, 33, 26, 10, 35, 14, 5, 29
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

3,1


COMMENTS

a(n) = prime(n)1, if A247190(n)=0; else a(n) = m1, where m is defined in A247190.
See comments in A247190.


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.


FORMULA

a(n) >= A247190(n).


MATHEMATICA

Table[ans={};
NestWhile[#+1&, 2, (AppendTo[ans, Mod[#!, Prime[n]]]; (Length[ans]<Prime[n]1)&&(Max[Last[Transpose[Tally[ans]]]]==1))&]1, {n, 3, 50}] (* Peter J. C. Moses, Nov 25 2014 *)


PROG

(Python)
from sympy import prime
def A245085(n):
....p, f, fv = prime(n), 1, {}
....for i in range(2, p):
........f = (f*i) % p
........if f in fv:
............return i1
........else:
............fv[f] = i
....return p1 # Chai Wah Wu, Dec 15 2014


CROSSREFS

Cf. A000040, A247190.
Sequence in context: A004493 A328238 A170929 * A299420 A019836 A020503
Adjacent sequences: A245082 A245083 A245084 * A245086 A245087 A245088


KEYWORD

nonn


AUTHOR

Vladimir Shevelev, Nov 25 2014


EXTENSIONS

More terms from Peter J. C. Moses, Nov 25 2014


STATUS

approved



