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.

A373751 Array read by ascending antidiagonals: p is a term of row A(n) if and only if p is a prime and p is a quadratic residue modulo prime(n).

This page as a plain text file.
%I A373751 #40 Oct 07 2024 02:04:37
%S A373751 2,3,3,5,7,5,2,11,13,7,3,7,19,19,11,3,5,11,29,31,13,2,13,11,23,31,37,
%T A373751 17,5,13,17,23,29,41,43,19,2,7,17,23,31,37,59,61,23,5,3,11,19,29,37,
%U A373751 43,61,67,29,2,7,13,17,43,43,47,53,71,73,31,3,5,13,23,19,47,53,53,67,79,79,37
%N A373751 Array read by ascending antidiagonals: p is a term of row A(n) if and only if p is a prime and p is a quadratic residue modulo prime(n).
%C A373751 p is a term of A(n) <=> p is prime and there exists an integer q such that q^2 is congruent to p modulo prime(n).
%H A373751 Robert G. Wilson v, <a href="/A373751/b373751.txt">Table of n, a(n) for n = 1..10011</a> (the first 141 antidiagonals, flattened).
%e A373751 Note that the cross-references are hints, not assertions about identity.
%e A373751 .
%e A373751 [ n] [ p]
%e A373751 [ 1] [ 2] [ 2,  3,  5,  7, 11, 13, 17, 19, 23, 29, ...  A000040
%e A373751 [ 2] [ 3] [ 3,  7, 13, 19, 31, 37, 43, 61, 67, 73, ...  A007645
%e A373751 [ 3] [ 5] [ 5, 11, 19, 29, 31, 41, 59, 61, 71, 79, ...  A038872
%e A373751 [ 4] [ 7] [ 2,  7, 11, 23, 29, 37, 43, 53, 67, 71, ...  A045373
%e A373751 [ 5] [11] [ 3,  5, 11, 23, 31, 37, 47, 53, 59, 67, ...  A056874
%e A373751 [ 6] [13] [ 3, 13, 17, 23, 29, 43, 53, 61, 79, 101, ..  A038883
%e A373751 [ 7] [17] [ 2, 13, 17, 19, 43, 47, 53, 59, 67, 83, ...  A038889
%e A373751 [ 8] [19] [ 5,  7, 11, 17, 19, 23, 43, 47, 61, 73, ...  A106863
%e A373751 [ 9] [23] [ 2,  3, 13, 23, 29, 31, 41, 47, 59, 71, ...  A296932
%e A373751 [10] [29] [ 5,  7, 13, 23, 29, 53, 59, 67, 71, 83, ...  A038901
%e A373751 [11] [31] [ 2,  5,  7, 19, 31, 41, 47, 59, 67, 71, ...  A267481
%e A373751 [12] [37] [ 3,  7, 11, 37, 41, 47, 53, 67, 71, 73, ...  A038913
%e A373751 [13] [41] [ 2,  5, 23, 31, 37, 41, 43, 59, 61, 73, ...  A038919
%e A373751 [14] [43] [11, 13, 17, 23, 31, 41, 43, 47, 53, 59, ...  A106891
%e A373751 [15] [47] [ 2,  3,  7, 17, 37, 47, 53, 59, 61, 71, ...  A267601
%e A373751 [16] [53] [ 7, 11, 13, 17, 29, 37, 43, 47, 53, 59, ...  A038901
%e A373751 [17] [59] [ 3,  5,  7, 17, 19, 29, 41, 53, 59, 71, ...  A374156
%e A373751 [18] [61] [ 3,  5, 13, 19, 41, 47, 61, 73, 83, 97, ...  A038941
%e A373751 [19] [67] [17, 19, 23, 29, 37, 47, 59, 67, 71, 73, ...  A106933
%e A373751 [20] [71] [ 2,  3,  5, 19, 29, 37, 43, 71, 73, 79, ...
%e A373751 [21] [73] [ 2,  3, 19, 23, 37, 41, 61, 67, 71, 73, ...  A038957
%e A373751 [22] [79] [ 2,  5, 11, 13, 19, 23, 31, 67, 73, 79, ...
%e A373751 [23] [83] [ 3,  7, 11, 17, 23, 29, 31, 37, 41, 59, ...
%e A373751 [24] [89] [ 2,  5, 11, 17, 47, 53, 67, 71, 73, 79, ...  A038977
%e A373751 [25] [97] [ 2,  3, 11, 31, 43, 47, 53, 61, 73, 79, ...  A038987
%e A373751 .
%e A373751 Prime(n) is a term of row n because for all n >= 1, n is a quadratic residue mod n.
%p A373751 A := proc(n, len) local c, L, a; a := 2; c := 0; L := NULL; while c < len do if NumberTheory:-QuadraticResidue(a, n) = 1 and isprime(a) then L := L,a; c := c + 1 fi; a := a + 1 od; [L] end: seq(print(A(ithprime(n), 10)), n = 1..25);
%t A373751 f[m_, n_] := Block[{p = Prime@ m}, Union[ Join[{p}, Select[ Prime@ Range@ 22, JacobiSymbol[#, If[m > 1, p, 1]] == 1 &]]]][[n]]; Table[f[n, m -n +1], {m, 12}, {n, m, 1, -1}]
%t A373751 (* To read the array by descending antidiagonals, just exchange the first argument with the second in the function "f" called by the "Table"; i.e., Table[ f[m -n +1, n], {m, 12}, {n, m, 1, -1}] *)
%o A373751 (SageMath)  # The function 'is_quadratic_residue' is defined in A373748.
%o A373751 def A373751_row(n, len):
%o A373751     return [a for a in range(len) if is_quadratic_residue(a, n) and is_prime(a)]
%o A373751 for p in prime_range(99): print([p], A373751_row(p, 100))
%o A373751 (PARI) A373751_row(n, LIM=99)={ my(q=prime(n)); [p | p <- primes([1,LIM]), issquare( Mod(p, q))] } \\ _M. F. Hasler_, Jun 29 2024
%Y A373751 Family: A217831 (Euclid's triangle), A372726 (Legendre's triangle), A372877 (Jacobi's triangle), A372728 (Kronecker's triangle), A373223 (Gauss' triangle), A373748 (quadratic residue/nonresidue modulo n).
%Y A373751 Cf. A374155 (column 1), A373748.
%Y A373751 Cf. A000040, A007645, A038872, A045373, A056874, A038883, A038889, A106863, A296932, A038901, A267481, A038913, A038919, A106891, A267601, A038901, A374156, A038941, A106933, A038957, A038977, A038987.
%K A373751 nonn,tabl
%O A373751 1,1
%A A373751 _Peter Luschny_, Jun 28 2024