OFFSET
1,1
COMMENTS
These primes are the smallest ones that introduce consecutive prime segments of length n, providing "maximum-diversity matrices". See A098213.
EXAMPLE
For n = 7: prime list = {2551,2557,2579,2591,2593,2609,2617}, consecutive differences = {6,22,12,2,16,8}, 7 X 7 matrix = [{abs(p(i)-p(j))], C[7,2] = 21 distinct positive matrix entries: {2,6,8,12,14,16,18,22,24,26,28,30,34,36,38,40,42,52,58,60,66}.
MATHEMATICA
a[n_] := Module[{v = Prime[Range[n]]}, While[CountDistinct@ Flatten@ Abs@ Outer[Plus, v, -v] - 1 != Binomial[n, 2], v = Join[v[[2 ;; -1]], {NextPrime[v[[-1]]]}]]; v[[1]]]; Array[a, 10] (* Amiram Eldar, Feb 23 2025 *)
PROG
(PARI) s(v) = {my(d = List()); for(i = 1, #v, for(j = 1, i-1, listput(d, abs(v[i] - v[j])))); #Set(d); }
a(n) = {my(v = primes(n), t = n*(n-1)/2, j = 1); while(s(v) != t, v[j] = nextprime(1 + if(j==1, v[n], v[j-1])); j++; if(j > n, j -= n)); v[j]; } \\ Amiram Eldar, Feb 23 2025
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Labos Elemer, Oct 29 2004
EXTENSIONS
a(14)-a(15) from Amiram Eldar, Feb 23 2025
STATUS
approved