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

 


A279074
Smallest positive number whose residues modulo the first n primes are all different but whose residues modulo the first n+1 primes are not all different.
3
1, 2, 3, 5, 8, 87, 116, 164, 203, 413, 712, 1478, 129, 472, 3033, 356, 6509, 202, 6753, 7769, 33724, 14614, 16574, 43844, 33164, 70988, 59405, 30777, 90878, 437408, 239644, 158944, 1088128, 359433, 171155, 390155, 99483, 680384, 845662, 1719404, 5597092
OFFSET
1,2
COMMENTS
For any k > 0, let r(j) = k mod prime(j) for all j > 0, and let f(k) be the number such that r(1), r(2), ..., r(f(k)) are all distinct, but r(f(k)+1) = r(j) for some j <= f(k). Then a(n) is the smallest positive number k such that f(k) = n.
The definition of A279073 is the same as that of this sequence except that A279073 does not include the requirement that the residues modulo the first n+1 primes not be all different. As a result, A279073 is strictly nondecreasing, whereas this sequence is not; A279073(n) = min_{i>=n} a(i). (See Example section.)
LINKS
Jon E. Schoenfield, Table of n, a(n) for n = 1..78
EXAMPLE
For n=6, the first n+1 primes are {2, 3, 5, 7, 11, 13, 17}, and at k=87, we get k mod {2, 3, 5, 7, 11, 13, 17} = {1, 0, 2, 3, 10, 9, 2}, of which the first n=6 residues are all different, but the 7th residue is a repeat of one of the earlier ones (i.e., 87 mod 17 = 87 mod 5). Thus, f(87) = 6, and since there exists no k < 87 for which f(k) = 6, we have a(6) = 87.
For n=13, 129 mod {each of the first n+1 primes} gives {1, 0, 4, 3, 8, 12, 10, 15, 14, 13, 5, 18, 6, 0}, of which the first n=13 residues are all different, but 129 mod prime(14) = 129 mod prime(2). Thus, f(129) = 13, and since there exists no k < 129 for which f(k) = 13, we have a(13) = 129. (Note that a(13) < a(n) for n=8..12; thus, since sequence A279073 does not have the requirement that the residue modulo the (n+1)-st prime be a repeat of one of the earlier residues, A279073(n)=129 not only for n=13, but also for n=8..12.)
MATHEMATICA
f[k_, m_]:=Mod[k, #]&/@Prime[Range[m]]; f[n_]:=Module[{k=1},
While[Or[Sort[f[k, n]]!=Union[f[k, n]], Sort[f[k, n+1]]==Union[f[k, n+1]]], k++]; k];
f/@Range[25] (* Ivan N. Ianakiev, Jan 17 2017 *)
PROG
(PARI) a(n) = {k = 1; ok = 0; while (!ok, vp = vector(n, j, k % prime(j)); vpo = vecsort(vp, , 8); if ((#vp == #vpo) && vecsearch(vpo, k % prime(n+1)), ok = 1, k++); ); k; } \\ Michel Marcus, Jan 22 2017
CROSSREFS
Cf. A279073.
Sequence in context: A272623 A042667 A279073 * A120495 A107477 A271525
KEYWORD
nonn
AUTHOR
Jon E. Schoenfield, Jan 15 2017
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 20 21:38 EDT 2024. Contains 376078 sequences. (Running on oeis4.)