cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A279074 #17 Jan 22 2017 21:40:09
%S A279074 1,2,3,5,8,87,116,164,203,413,712,1478,129,472,3033,356,6509,202,6753,
%T A279074 7769,33724,14614,16574,43844,33164,70988,59405,30777,90878,437408,
%U A279074 239644,158944,1088128,359433,171155,390155,99483,680384,845662,1719404,5597092
%N 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.
%C A279074 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.
%C A279074 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.)
%H A279074 Jon E. Schoenfield, <a href="/A279074/b279074.txt">Table of n, a(n) for n = 1..78</a>
%e A279074 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.
%e A279074 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.)
%t A279074 f[k_,m_]:=Mod[k,#]&/@Prime[Range[m]];f[n_]:=Module[{k=1},
%t A279074 While[Or[Sort[f[k,n]]!=Union[f[k,n]],Sort[f[k,n+1]]==Union[f[k,n+1]]],k++];k];
%t A279074 f/@Range[25] (* _Ivan N. Ianakiev_, Jan 17 2017 *)
%o A279074 (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
%Y A279074 Cf. A279073.
%K A279074 nonn
%O A279074 1,2
%A A279074 _Jon E. Schoenfield_, Jan 15 2017