%I #25 Oct 20 2024 18:36:17
%S 29,43,67,69,77,115,136,171,173,187,189,219,224,235,237,245,259,267,
%T 283,285,291,296,317,339,341,344,355,365,368,376,381,403,405,411,413,
%U 424,427,429,435,437,451,453,485,501,507,536,549,555,568,576,595,597,603,605
%N Numbers k with the property that there exists a matrix of squares m = [p^2, q^2; r^2, s^2] such that p, q, r, s are all distinct primes less than k, and det(m) = k.
%e 29 belongs to this sequence because we have a matrix m = [25, 49; 4, 9] in which each element is the square of a prime smaller than 29, and det(m) = 25*9 - 49*4 = 29.
%t t[x_, n_] := Block[{f = FactorInteger@x}, Last /@ f == {1,1} && f[[2,1]] < n]; ok[n_] := Block[{s = List@ ToRules@ Reduce[n == x^2-y^2 && x>y>0, {x,y}, Integers]}, s =!= {} && AnyTrue[ {x,y}/.s, GCD @@ # == 1 && t[#[[1]], n] && t[#[[2]], n] &]]; Select[Range[400], ok] (* _Giovanni Resta_, Jul 12 2018 *)
%o (MiniZinc)
%o include "globals.mzn";
%o int: n = 4;
%o %to get all numbers less than 250 of this sequence
%o int: max_val = 250;
%o array[1..n+1] of var 2..max_val: x;
%o % primes between 2..max_val
%o set of int: prime = 2..max_val diff { i | i in 2..max_val, j in 2..ceil(sqrt(i)) where i mod j = 0} ;
%o set of int: primes;
%o primes = prime union {2};
%o solve satisfy;
%o constraint all_different(x) /\ x[1] in primes /\ x[2] in primes /\ x[3] in primes /\ x[4] in primes /\ forall(i in 1..n) ((x[i]<x[5])) /\ pow(x[1],2)*pow(x[4],2)-pow(x[2],2)*pow(x[3],2) = x[5];
%o output [ show(x[5]) ];
%K nonn
%O 1,1
%A _Pierandrea Formusa_, Jul 11 2018
%E More terms from _Giovanni Resta_, Jul 12 2018