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.

A371497 Irregular triangle read by rows: n-th row gives congruence classes s such that the n-th prime q is a quadratic residue modulo an odd prime p if and only if p = plus or minus s for some s (mod m), where m = q if q is of the form 4k + 1, else m = 4q.

This page as a plain text file.
%I A371497 #15 Apr 20 2024 10:16:55
%S A371497 1,1,1,1,3,9,1,5,7,9,19,1,3,4,1,2,4,8,1,3,5,9,15,17,25,27,31,1,7,9,11,
%T A371497 13,15,19,25,29,41,43,1,4,5,6,7,9,13,1,3,5,9,11,15,23,25,27,33,41,43,
%U A371497 45,49,55,1,3,4,7,9,10,11,12,16,1,2,4,5,8,9,10,16,18,20,1,3,7,9,13,17
%N A371497 Irregular triangle read by rows: n-th row gives congruence classes s such that the n-th prime q is a quadratic residue modulo an odd prime p if and only if p = plus or minus s for some s (mod m), where m = q if q is of the form 4k + 1, else m = 4q.
%C A371497 If n-th prime q is of the form 4k + 1, then by quadratic reciprocity row n consists of quadratic residues mod q, that are less than 2k; i.e., for q > 3, the first half of the corresponding row in A063987.
%C A371497 The first term in each row is always 1.
%e A371497 The 1st prime, 2, not of the form 4k + 1, is a square modulo odd primes p if and only if p = +/- 1 (mod 4*2 = 8).
%e A371497 The 6th prime, 13, of the form 4k + 1, is a square modulo odd primes p if and only if p = +/- 1, +/- 3, or +/- 4 (mod 13).
%e A371497 The irregular triangle T(n,k) begins (q is prime(n)):
%e A371497  n   q \k 1 2 3 4 5 6 7 8 9 10 11
%e A371497  1,  2: 1
%e A371497  2,  3: 1
%e A371497  3,  5: 1
%e A371497  4,  7: 1 3 9
%e A371497  5, 11: 1 5 7 9 19
%e A371497  6: 13: 1 3 4
%e A371497  7, 17: 1 2 4 8
%e A371497  8, 19: 1 3 5 9 15 17 25 27 31
%e A371497  9, 23: 1 7 9 11 13 15 19 25 29 41 43
%e A371497 10, 29: 1 4 5 6 7 9 13
%o A371497 (Python)
%o A371497 from sympy import prime
%o A371497 def A371497_row(n):
%o A371497     q = prime(n)
%o A371497     res = {i*i % q for i in range(1, q//2 + 1)}
%o A371497     if q % 4 == 1:
%o A371497         res = {a for a in res if 2*a < q}
%o A371497     else:
%o A371497         res = {((a % 4 - 1) * q + a) % (4*q) for a in res}
%o A371497         res = {a if a < 2*q else 4*q - a for a in res}
%o A371497     return sorted(res)
%Y A371497 Cf. A063987, A081728.
%K A371497 nonn,tabf,easy
%O A371497 1,5
%A A371497 _Nick Hobson_, Mar 25 2024