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-1 of 1 results.

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-1 of 1 results.