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

A330423 Least nonsquare k that is a quadratic residue modulo n and is coprime to n.

Original entry on oeis.org

2, 3, 7, 5, 6, 7, 2, 17, 7, 11, 3, 13, 3, 11, 19, 17, 2, 7, 5, 21, 22, 3, 2, 73, 6, 3, 7, 29, 5, 19, 2, 17, 31, 13, 11, 13, 3, 5, 10, 41, 2, 37, 6, 5, 19, 3, 2, 73, 2, 11, 13, 17, 6, 7, 14, 57, 7, 5, 3, 61, 3, 5, 22, 17, 14, 31, 6, 13, 13, 11, 2, 73, 2, 3, 19, 5, 15
Offset: 1

Views

Author

Jianing Song, Dec 14 2019

Keywords

Comments

a(n) > n if and only if n is in A303704.
It seems that lim_{n->oo} a(n)/n = 0. Conjectured last term m such that a(m)/m > 1/k, k = 1, 2, 3, ...: 840, 1680, 2640, 9240, 10920, 10920, 18480, 18480, 21840, 29640, ...

Examples

			k is a coprime quadratic residue modulo 16 if and only if k == 1 (mod 8). Since 1 and 9 are squares, a(16) = 17.
k is a coprime quadratic residue modulo 24 if and only if k == 1 (mod 24). Since 1, 25 and 49 are squares, a(24) = 73.
k is a coprime quadratic residue modulo 840 if and only if k == 1, 121, 169, 289, 361, 529 (mod 840). Since 1, 121, 169, 289, 361, 529, 841, 961 are squares, a(840) = 840+169 = 1009.
		

Crossrefs

Programs

  • PARI
    a(n) = my(k=1); while(!issquare(Mod(k,n)) || issquare(k) || gcd(k,n)>1, k++); k

A309680 The smallest nonsquare nonzero integer that is a quadratic residue modulo n, or 0 if no such integer exists.

Original entry on oeis.org

0, 0, 0, 0, 0, 3, 2, 0, 7, 5, 3, 0, 3, 2, 6, 0, 2, 7, 5, 5, 7, 3, 2, 12, 6, 3, 7, 8, 5, 6, 2, 17, 3, 2, 11, 13, 3, 5, 3, 20, 2, 7, 6, 5, 10, 2, 2, 33, 2, 6, 13, 12, 6, 7, 5, 8, 6, 5, 3, 21, 3, 2, 7, 17, 10, 3, 6, 8, 3, 11, 2, 28, 2, 3, 6, 5, 11, 3, 2, 20, 7
Offset: 1

Views

Author

John Prosser, Aug 12 2019

Keywords

Examples

			For n=5, the nonzero quadratic residues modulo 5 are 1 and 4. Since these are both squares we have a(5) = 0.
For n=6, the nonzero quadratic residues modulo 6 are 1,3, and 4. Since 3 is not a square we have a(6) = 3.
For n=10, the nonzero quadratic residues modulo 10 are 1,4,5,6,9. Since 5 is the least nonsquare value, we have a(10) = 5.
		

Crossrefs

A330404 is an alternate version.

Programs

  • Mathematica
    a[n_] := SelectFirst[ Union@ Mod[Range[n-1]^2, n], ! IntegerQ@ Sqrt@ # &, 0]; Array[a, 81] (* Giovanni Resta, Aug 13 2019 *)
  • PARI
    a(n) = my(v=select(x->issquare(x), vector(n-1, k, Mod(k,n)), 1), y = select(x->!issquare(x), Vec(v))); if (#y, y[1], 0); \\ Michel Marcus, Aug 16 2019

Formula

a(n) = 2 for n in A057126 and n > 2. - Michel Marcus, Aug 24 2019
Showing 1-2 of 2 results.