Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
A257529
Prime numbers that have a pentagonal Voronoi cell in the Voronoi diagram of the Ulam prime spiral.
1
2, 3, 11, 13, 17, 19, 29, 37, 53, 83, 97, 101, 103, 107, 109, 113, 137, 149, 151, 163, 191, 197, 211, 223, 227, 241, 257, 271, 281, 293, 307, 337, 347, 373, 401, 419, 431, 433, 461, 521, 523, 541, 563, 569, 571, 577, 593, 619, 653, 659, 673
OFFSET
1,1
PROG
(MATLAB)
sz = 201; % Size of the N x N square matrix
mat = spiral(sz); % MATLAB Function
k = 1;
for i =1:sz
for j=1:sz
if isprime(mat(i, j)) % Check if the number is prime
% saving indices of primes
y(k) = i; x(k) = j;
k = k+1;
end
end
end
xy = [x', y'];
[v, c] = voronoin(xy); % Returns Voronoi vertices V and
% the Voronoi cells C
k = 1;
for i = 1:length(c)
szv = size(v(c{i}, 1));
polyN(i) = szv(1);
if polyN(i) == 5
A(k) = mat(y(i), x(i));
k = k+1;
end
end
% Print terms
A = sort(A);
fprintf('A = ');
fprintf('%i, ', A);
% Note that the last terms might not be correct.
% They correspond to the points on the outer edges of the spiral which might be altered when considering a larger spiral.
% Use larger spiral to get more terms
CROSSREFS
KEYWORD
nonn
AUTHOR
Vardan Semerjyan, Apr 28 2015
STATUS
approved