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.

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.

This page as a plain text file.
%I A385051 #20 Jul 12 2025 19:49:48
%S A385051 1,2,8,68,173,593,1748,908,40178,74093,91538,93308,441803,10712063,
%T A385051 7898483,35865968,133019963,206951093,1314259253,2453647853,
%U A385051 6701493818,54776939873,7717930358,250589717363,255937042268,3665861003153,957987212453,9953155219223
%N 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.
%C A385051 Only relevant for odd primes, as every positive integer is a square mod 2.
%C A385051 For n >= 3, {a(n) mod 105} = {68, 83}.
%e A385051 a(0) = 1: |{}| = 0: terminates at 1 mod 3 (square: = 1^2 mod 3).
%e A385051 a(1) = 2: |{2}| = 1: 2 mod 3 = 2 (nonsquare), terminates at 2 mod 5 (not distinct: repeats 2 mod 3).
%e A385051 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).
%e A385051 a(3) = 68: |{2, 3, 5}| = 3.
%o A385051 (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))}
%Y A385051 Cf. A376999 (nondistinct nonsquares), A385050 (distinct squares), A279074 (distinct moduli).
%K A385051 nonn
%O A385051 0,2
%A A385051 _Charles L. Hohn_, Jun 16 2025