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.
%I A359633 #10 Jan 15 2023 15:23:09 %S A359633 2,7,29,53,59,137,139,173,179,193,197,223,241,251,317,353,383,389,409, %T A359633 419,457,461,467,541,557,563,593,601,607,701,743,761,769,773,787,797, %U A359633 811,853,857,859,881,883,929,937,941,947,977,991,1009,1013,1019,1033,1039,1049,1051,1097,1129,1153,1171 %N A359633 a(n) is the least prime > a(n-1) such that a(n-1) and a(n) are quadratic residues mod each other. %C A359633 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). %H A359633 Robert Israel, <a href="/A359633/b359633.txt">Table of n, a(n) for n = 1..10000</a> %e A359633 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. %p A359633 f:= proc(p) local q; %p A359633 q:= p; %p A359633 do %p A359633 q:= nextprime(q); %p A359633 if NumberTheory:-QuadraticResidue(q,p) = 1 and NumberTheory:-QuadraticResidue(p,q) = 1 then return q fi %p A359633 od %p A359633 end proc: %p A359633 A[1]:= 2: for i from 2 to 100 do A[i]:= f(A[i-1]) od: %p A359633 seq(A[i], i=1..100); %Y A359633 Cf. A034794, A034795. %K A359633 nonn %O A359633 1,1 %A A359633 _Robert Israel_, Jan 07 2023