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.

A376999 a(n) is the least number k that is a quadratic residue modulo prime(n) but is a quadratic nonresidue modulo all previous odd primes.

Original entry on oeis.org

0, 5, 2, 38, 17, 83, 362, 167, 227, 2273, 398, 5297, 64382, 69467, 116387, 238262, 214037, 430022, 5472953, 9481097, 8062073, 41941577, 86374763, 312521282
Offset: 2

Views

Author

Robert Israel, Oct 20 2024

Keywords

Examples

			a(5) = 38 because 38 is a quadratic residue modulo prime(5) = 11 but is not a quadratic residue modulo the previous odd primes 3, 5 and 7, and no number smaller than 38 works.
		

Crossrefs

Cf. A377212.

Programs

  • Maple
    f:= proc(n) local k,p;
      p:= 2;
      for k from 2 do
          p:= nextprime(p);
          if numtheory:-quadres(n,p) = 1 then return k fi
      od
    end proc:
    V:= Array(2..25): count:= 0:
    for k from 2 while count < 24 do
      v:= f(k);
    if v > 0 and v <= 25 and V[v] = 0 then
      V[v]:= k; count:= count+1;
    fi;
    od:
    V[2]:= 0:
    convert(V,list);