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.

A257745 Prime numbers that have a hexagonal Voronoi cell in the Voronoi diagram of the Ulam prime spiral.

This page as a plain text file.
%I A257745 #9 Dec 16 2017 18:01:27
%S A257745 5,7,41,43,89,127,179,193,233,263,283,317,379,383,397,443,457,487,503,
%T A257745 547,599,607,631,643,647,719,733,787,809,821,839,937,947,971,977,997,
%U A257745 1019,1039,1049,1069,1091,1097,1103,1109,1187,1193,1217,1231
%N A257745 Prime numbers that have a hexagonal Voronoi cell in the Voronoi diagram of the Ulam prime spiral.
%H A257745 Vardan Semerjyan, <a href="http://smallsats.org/2014/01/03/voronoi-diagram-of-prime-spiral/">Voronoi diagram of prime spiral</a>
%o A257745 (MATLAB)
%o A257745 sz  = 201; % Size of the N x N square matrix
%o A257745 mat = spiral(sz); % MATLAB Function
%o A257745 k = 1;
%o A257745 for i =1:sz
%o A257745     for j=1:sz
%o A257745         if isprime(mat(i,j)) % Check if the number is prime
%o A257745             % saving indices of primes
%o A257745             y(k) = i; x(k) = j;
%o A257745             k = k+1;
%o A257745         end
%o A257745     end
%o A257745 end
%o A257745 xy = [x',y'];
%o A257745 [v,c] = voronoin(xy); %  Returns Voronoi vertices V and
%o A257745 % the Voronoi cells C
%o A257745 k = 1;
%o A257745 for i = 1:length(c)
%o A257745   szv = size(v(c{i},1));
%o A257745   polyN(i) = szv(1);
%o A257745   if polyN(i) == 6
%o A257745         A(k) = mat(y(i),x(i));
%o A257745         k = k+1;
%o A257745       end
%o A257745 end
%o A257745 % Print terms
%o A257745 A = sort(A);
%o A257745 fprintf('A = ');
%o A257745 fprintf('%i, ',A);
%o A257745 % When running the code be aware that the last terms you get might not be correct.
%o A257745 % They correspond to the points on the outer edges of the spiral which might be
%o A257745 % altered when considering a larger spiral.
%o A257745 % Use larger spiral to get more terms
%Y A257745 Cf. A257527, A257528, A000040.
%K A257745 nonn
%O A257745 1,1
%A A257745 Vardan Semerjyan, May 07 2015