%I #27 Feb 25 2021 21:24:15
%S 1,2,3,3,4,4,2,6,3,6,12,0,4,6,9,4,2,8,0,6,3,9,18,4,4,0,0,2,14,18,8,2,
%T 4,6,0,18,0,6,9,0,8,2,0,4,0,72,6,3,0,0,0,10,0,18,0,0,4,4,0,3,49,28,0,
%U 0,12,24,12,6,0,0,15,9,0,6,6,0,0,16,0,0,10,0,0,3,9,0,0,0,4,0,12,12,0,0,4,24,0,11,21,12
%N The areas of the triangles formed by joining three consecutive primes as vertices on the Ulam spiral.
%C The sequences lists the areas of the triangles formed by joining three consecutive primes, A000040(n), A000040(n+1), and A000040(n+2), as vertices on the Ulam spiral. As n increases the majority of terms are zero as most of the consecutive primes triples will fall on the same vertical or horizontal line forming the square spiral; only those primes near the corners of the spiral will form nonzero area triangles.
%C Assuming the truth of the Legendre conjecture one can show all areas will be integer values. Consider that the area, A, of a triangle is given by half the magnitude of the cross product of the vectors from the second prime of the triple to the first and third primes, i.e., A = |x_1*y_2 - y_1*x_2|/2. Any two primes on the same vertical or horizontal line of the spiral will always be a multiple of two units apart, so either x_1 = 2*k, y_1 = 0, or x_1 = 0, y_1 = 2*k where k is an integer with |k| >= 0. Assuming the third prime is not on the same line then A will be an even number divided by 2, which is always an integer. The only possibility for A being a non-integer is for all three primes to lie on three different vertical and/or horizontal spiral lines. Note that only the lower-right corner of the spiral has an even number. Therefore if we start on any right vertical line moving counterclockwise one complete revolution all primes will be an even number from the first three visited corners, so any vector connecting these primes will be of the form (2*j,2*k), implying once again the resulting triangle will have an integer value. So the remaining possibility is that the path between the three consecutive primes crosses the south-east corner at least once, for example the first prime is on the lower horizontal line and then the second is on the adjacent vertical right line. Such an example would be 23 to 29. But now, due to the above restriction that the next prime cannot be on the top, left, or bottom line if the proceeding prime is on the right vertical line, the third prime would need to form a path of one complete revolution and be on the next outer right vertical line. In the example case given this means it would have to be 51 or more. But in completing this revolution the path crosses both the top-left corner of the spiral, which is next to the numbers of the form (2*p)^2, and also the bottom right corner, which is next to numbers of the form (2*p+1)^2, and so it crosses consecutive squares without forming a prime. This violates the Legendre conjecture which, if true, therefore implies all triangles between three consecutive primes on the Ulam spiral will have an integer area.
%C For an Ulam spiral of size 20001 by 20001, with largest prime just over 400 million, the largest triangle area is 5160, between consecutive primes 364008101, 364008181 and 364008371. The first occurrence of three consecutive triangles with the same area, with area > 0, is for primes (2293,2297,2309), (2297,2309,2311), (2347,2351,2357), all of which form a triangle of area 8. Sixteen other runs with three consecutive triangles with the same area were also found, but no run of four triangles. The smallest triangle area which has not been formed is 79, although this minimum value slowly increases as the spiral gets larger, so it is likely, but unknown, that eventually triangles of all integer values are created.
%H Scott R. Shannon, <a href="/A331377/a331377.png">Image showing the triangles for primes up to 40193</a>. The triangles are shaded based on their size, from red, area = 1, up to violet, area = 312.
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Ulam_spiral">Ulam spiral</a>.
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Triangle#Computing_the_area_of_a_triangle">Triangle</a>.
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Legendre%27s_conjecture">Legendre's conjecture</a>.
%e a(1) = 1 as the relative coordinates of the first three primes, 2,3,5, from the central 1 square are (1,0), (1,1), and (-1,1), which form a triangle with area |0*0 - -2*-1|/2 = 1.
%e a(3) = 3 as the relative coordinates of the third to fifth primes, 5,7,11, from the central 1 square are (-1,1), (-1,-1), and (2,0), which form a triangle with area |-3*-1 - -3*1|/2 = 3.
%e a(12) = 0 as the relative coordinates of the twelfth to fourteenth primes, 37,41,43, from the central 1 square are (-3,3), (-3,-1), and (-3,-3), all of which lie on the same vertical line so the triangle formed has zero area.
%Y Cf. A000040, A063826, A214664, A214665.
%K nonn
%O 1,2
%A _Scott R. Shannon_, Jan 14 2020
|