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.

A359633 a(n) is the least prime > a(n-1) such that a(n-1) and a(n) are quadratic residues mod each other.

Original entry on oeis.org

2, 7, 29, 53, 59, 137, 139, 173, 179, 193, 197, 223, 241, 251, 317, 353, 383, 389, 409, 419, 457, 461, 467, 541, 557, 563, 593, 601, 607, 701, 743, 761, 769, 773, 787, 797, 811, 853, 857, 859, 881, 883, 929, 937, 941, 947, 977, 991, 1009, 1013, 1019, 1033, 1039, 1049, 1051, 1097, 1129, 1153, 1171
Offset: 1

Views

Author

Robert Israel, Jan 07 2023

Keywords

Comments

Quadratic reciprocity says that for odd primes p and q, if p is a quadratic residue mod q then q is a quadratic residue mod p except in the case where p and q are both congruent to 3 (mod 4), in which case they can't both be quadratic residues mod each other. Thus if a(n-1) == 1 (mod 4), a(n) is the least prime > a(n-1) that is a quadratic residue mod a(n-1), while if a(n-1) == 3 (mod 4), a(n) is the least prime > a(n-1) that is congruent to 1 (mod 4) and is a quadratic residue mod a(n-1).

Examples

			a(3) = 29 because a(2) = 7, 29 is a quadratic residue mod 7 and 7 is a quadratic residue mod 29, and 29 is the least prime > 7 that works.
		

Crossrefs

Programs

  • Maple
    f:= proc(p) local q;
       q:= p;
       do
         q:= nextprime(q);
         if NumberTheory:-QuadraticResidue(q,p) = 1 and NumberTheory:-QuadraticResidue(p,q) = 1  then return q fi
       od
    end proc:
    A[1]:= 2: for i from 2 to 100 do A[i]:= f(A[i-1]) od:
    seq(A[i], i=1..100);
Showing 1-1 of 1 results.