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.

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))}