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.

Showing 1-4 of 4 results.

A279073 Smallest positive number whose residues modulo the first n primes are all different.

Original entry on oeis.org

1, 2, 3, 5, 8, 87, 116, 129, 129, 129, 129, 129, 129, 202, 202, 202, 202, 202, 6753, 7769, 14614, 14614, 16574, 30777, 30777, 30777, 30777, 30777, 90878, 99483, 99483, 99483, 99483, 99483, 99483, 99483, 99483, 680384, 845662, 1719404, 1787204, 1787204, 1787204
Offset: 1

Views

Author

Jon E. Schoenfield, Jan 12 2017

Keywords

Comments

This sequence begins like the Fibonacci sequence. Are any terms beyond a(5) = 8 also Fibonacci numbers?
From Jon E. Schoenfield, Jan 15 2017: (Start)
a(n) = min_{k : A279086(k) >= n}.
For the smallest positive number having exactly n distinct residues modulo p before the first repeated residue occurs as p runs through the primes, see A279074. (E.g., a(n)=129 for n=8..13, but A279074(n)=129 only at n=13.) (End)

Examples

			For n=6, the first n primes are {2, 3, 5, 7, 11, 13}; 87 mod {2, 3, 5, 7, 11, 13} = {1, 0, 2, 3, 10, 9} (all different), and this does not occur for any k < 87, so a(6) = 87.
For n=8, 129 mod (each of the first n primes) gives {1, 0, 4, 3, 8, 12, 10, 15} (all different), and this does not occur for any k < 129, so a(8) = 129. Additionally, 129 mod p for each of the next 5 primes p gives {14, 13, 5, 18, 6} (all different from the first eight residues and from each other), so 129 is also a(9)..a(13). (This run of identical terms stops at n=13, since 129 mod prime(14) = 129 mod 43 = 0 = 129 mod prime(2).)
		

Crossrefs

Programs

  • Mathematica
    f[k_, m_] := Mod[k, #] & /@ Prime[Range[m]]; lst = {1};
    f[n_] := Module[{k = Last[lst]},While[Sort[f[k, n]] != Union[f[k, n]], k++]; AppendTo[lst, k]];f /@ Range[30]; Rest[lst] (* Ivan N. Ianakiev, Jan 17 2017 *)
  • PARI
    a(n) = {k = 1; ok = 0; while (!ok, vp = vector(n, j, k % prime(j)); if (#vecsort(vp,,8) == n, ok = 1, k++);); k;} \\ Michel Marcus, Jan 22 2017

A279086 Number of distinct residues n mod p encountered before the first repeated residue as p runs through the primes.

Original entry on oeis.org

1, 2, 3, 3, 4, 1, 1, 5, 5, 2, 2, 1, 1, 3, 2, 2, 2, 1, 1, 2, 2, 3, 3, 1, 1, 5, 5, 3, 3, 1, 1, 2, 4, 4, 3, 1, 1, 3, 3, 2, 2, 1, 1, 3, 2, 2, 2, 1, 1, 2, 2, 5, 5, 1, 1, 3, 3, 4, 4, 1, 1, 2, 3, 3, 3, 1, 1, 4, 5, 2, 2, 1, 1, 3, 2, 2, 2, 1, 1, 2, 2, 4, 4, 1, 1, 3, 6
Offset: 1

Views

Author

Jon E. Schoenfield, Jan 15 2017

Keywords

Comments

A279073(j) = min_{n : a(n) >= j}.
A279074(j) = min_{n : a(n) = j}.

Examples

			For n=11, the residues n mod prime(j) for j>=1 begin with 11 mod 2 = 1, 11 mod 3 = 2, and 11 mod 5 = 1; the first 2 residues are distinct, but the 3rd is a repeat of an earlier one, so a(11) = 2.
For n=87, the residues n mod prime(j) for j>=1 begin with 87 mod 2 = 1, 87 mod 3 = 0, 87 mod 5 = 2, 87 mod 7 = 3, 87 mod 11 = 10, 87 mod 13 = 9, 87 mod 17 = 2; the first 6 residues are all distinct, but the 7th is a repeat (87 mod 17 = 87 mod 5 = 2), so a(87) = 6.
		

Crossrefs

A385050 a(n) is the least positive number k such that n is the greatest m such that k is a quadratic residue mod prime(i) for i=1..m and {k mod prime(i): i=1..m} are all distinct.

Original entry on oeis.org

1, 3, 4, 184, 9, 1479, 20799, 31509, 162094, 83554, 828844, 895449, 4631104, 86925309, 97476129, 14684224, 33547264, 5381151099, 516743824, 1958770564, 112746608529, 3046156864, 373079083204, 1394424964, 297469886464, 1596601563489, 976001733184, 33344131402059
Offset: 1

Views

Author

Charles L. Hohn, Jun 16 2025

Keywords

Comments

For n >= 4, {a(n) mod 105} = {9, 79}.

Examples

			a(1) = 1: |{1}| = 1: 1 mod 2 = 1^2 mod 2, terminates at 1 mod 3 (not distinct: repeats 1 mod 2).
a(2) = 3: |{1, 0}| = 2: 3 mod 2 = 1^2 mod 2, 3 mod 3 = 0^2 mod 3, terminates at 3 mod 5 (nonsquare).
a(3) = 4: |{0, 1, 4}| = 3.
a(4) = 184: |{0, 1, 4, 2}| = 4 (2 = 3^2 mod 7).
a(5) = 9: |{1, 0, 4, 2, 9}| = 5.
a(6) = 1479: |{1, 0, 4, 2, 5, 10}| = 6.
		

Crossrefs

Cf. A377212 (nondistinct squares), A385051 (distinct nonsquares), A279074 (distinct moduli).

Programs

  • PARI
    a(n)={my(v=List); for(k=1, oo, my(m=Map); for(i=1, oo, my(p=prime(i), kp=k%p); if(i>#v, listput(v, Map); for(j=0, (p-p%2)/2, mapput(v[i], j^2%p, 1))); if(mapisdefined(v[i], kp) && !mapisdefined(m, kp), mapput(m, kp, 1); next); if(i-1==n, return(k)); break))}

A385051 a(n) is the least positive number k such that n is the greatest m such that k is a quadratic nonresidue mod prime(i+1) for i=1..m and {k mod prime(i+1): i=1..m} are all distinct.

Original entry on oeis.org

1, 2, 8, 68, 173, 593, 1748, 908, 40178, 74093, 91538, 93308, 441803, 10712063, 7898483, 35865968, 133019963, 206951093, 1314259253, 2453647853, 6701493818, 54776939873, 7717930358, 250589717363, 255937042268, 3665861003153, 957987212453, 9953155219223
Offset: 0

Views

Author

Charles L. Hohn, Jun 16 2025

Keywords

Comments

Only relevant for odd primes, as every positive integer is a square mod 2.
For n >= 3, {a(n) mod 105} = {68, 83}.

Examples

			a(0) = 1: |{}| = 0: terminates at 1 mod 3 (square: = 1^2 mod 3).
a(1) = 2: |{2}| = 1: 2 mod 3 = 2 (nonsquare), terminates at 2 mod 5 (not distinct: repeats 2 mod 3).
a(2) = 8: |{2, 3}| = 2: 8 mod 3 = 2 (nonsquare), 8 mod 5 = 3 (nonsquare), terminates at 8 mod 7 (square: = 1^2 mod 7).
a(3) = 68: |{2, 3, 5}| = 3.
		

Crossrefs

Cf. A376999 (nondistinct nonsquares), A385050 (distinct squares), A279074 (distinct moduli).

Programs

  • PARI
    a(n)={my(v=List); for(k=1, oo, my(m=Map); for(i=1, oo, my(p=prime(i+1), kp=k%p); if(i>#v, listput(v, Map); for(j=0, (p-p%2)/2, mapput(v[i], j^2%p, 1))); if(!mapisdefined(v[i], kp) && !mapisdefined(m, kp), mapput(m, kp, 1); next); if(i-1==n, return(k)); break))}
Showing 1-4 of 4 results.