Notes on the sequence of Bostrophedon primes (A330399) and the "ski-run" A330545. Neil J. A. Sloane Jan 04 2020 Summary: We describe the construction of those two sequences and prove that all Boustrophedon primes are == 1 (mod 4). The two sequences A330339 and A330545 arise from the following problem, proposed by Eric Angelini in December 2019. Take a sheet of squared paper and label the columns with the integers Z, and label the rows by the positive integers N. (The labels apply to cells of the paper, not to the grid lines between the cells.) Draw a path through the cells by writing 0 in cell 0 in row 1, and move right, numbering the squares 1,2,3,... until reaching the first prime, which is 2. Move down to next row, row 2, and place the next number (3) immediately under 2, and change direction. We move left until reaching the next prime, which is 3 (we don't need to move!). Move down to row 3, and place the next number (4) under the 3, and move right until we reach the next prime, which is 5. Move to next row, place 6 under the 5, and and move left, and so on. Each time we reach a prime, we write the next number directly under that prime, and change direction. Here is the beginning of the path: ... -1 0 1 2 3 4 5 6 7 8 9 10 ... (column labels) ------------------------------------------ row label 0 1 2 1 3 2 4 5 3 7 6 4 8 9 10 11 5 13 12 6 14 15 16 17 7 19 18 8 20 21 22 23 9 29 28 27 26 25 24 10 30 31 11 37 36 35 34 33 32 12 38 39 40 41 13 43 42 14 44 45 46 47 15 53 53 51 50 49 48 16 54 55 ... 17 Note that we can trace the path without lifting the pen from the paper (except to number the squares). This way of writing - where the rows reverse direction with each line - is called "boustrophedon" (or "ox-plowing") writing, since it is the way an ox plows a field. Eric Angelini defined the "boustrophedon primes" to be the primes 37, 53, 89, 113, ..., that land in column 0. These primes now form sequence A330339 in the OEIS, and the b-file there shows the first 10000 boustrophedon primes. Eric Angelini's illustration in A330339 also shows the start of this array, and Walter Trump's illustrations show the first 550 rows. If we focus just on the primes on the squared paper, we see one prime in each row, and by joining successive primes by straight lines, we get a picture that looks rather like a ski-run. Sequence A330545 lists the columns in which the primes appear. Every zero term in this sequence corresponds to a boustrophedon prime: if A330545(k) = 0 then p_k is a boustrophedon prime (p_k denotes the k-th prime). My illustration in A330545 shows the first 16 rows of this ski-run. Hans Havermann's illustration for A330545 show the first 4*10^8 terms of the ski-run, but rotated by 90 degrees, so that the downhill direction on the ski slope is along the x-axis. This must be the world's longest ski-run. His graph was obtained by sampling the sequence every 1000 terms. A second illustration from Hans Havermann in A330545 shows an enlargement of the portion of the graph from 290 million to 310 million terms. These two graphs can reasonably be described as mind-boggling. (FN1) Frank Stevenson has recently extended the graph of A330545 to 10^10 terms (FN2). Although the graph has wild oscillations, up to this point- the sequence seems to satisfy lim sup |A330545(n)| <= n^(2/3). There is at least /some/ regularity in the positions of the primes. Theorem: Starting at row 2, the primes in column c are congruent to 1,3,3,1 mod 4 according as c is congruent to 0,1,2,3 mod mod 4 Corollary: The boustrophedon primes (which by definition are those in column zero) are congruent to 1 mod 4. Proof of theorem: We will say that a prime p has type 1 if it is congruent to 1 mod 4, and type 3 if it is congruent to 3 mod 4. Define the state of an odd prime p in the ski-run to be (c,t), where c is its column number read mod 4 and t is its type. The primes 3, 5, 7, 11 have states ((2,3), (3,1), (2,3), and (1,3) respectively. The states of all the odd primes are given in the state diagram shown in A330545. Since the direction of movement alternates at each row, there are always only two possibilities for the next state, depending on whether Delta p_n = p_{n+1} - p_n is congruent to 0 or 2 mod 4. The edges in the state diagram are labeled with the pairs (Delta p_n, direction). We observe that only four states occur, and so the value c of the column number mod 4 uniquely determines the type of all the primes in that column. There /could/ have been states (0,3), (1,1), (2,1), and (3,3), but these simply do not occur. QED Primes in A330547. Here the analysis is simpler. The primes (other than 2) occur only in odd-numbered columns: primes of type 3 occur in columns congruent to 1 mod 4, and primes of type 1 occur in columns congruent to 3 mod 4. This shows that the primes A282178 are congruent to 3 mod 4. (Thote that the column numbers in A330547 are one more than the column numbers in A282178.) Footnotes --------- (FN1) These wild oscillations can probably be explained in the same way that the oscillations in the "great prime race" between primes congruent to 1 mod 4 and 3 mod 4 are explained. See Michael Rubinstein and Peter Sarnak, Chebyshev’s Bias, Experimental Mathematics, 3.3 (1994): 173-197; and Andrew Granville and Greg Martin, Prime number races, American Mathematical Monthly, 113.1 (2006): 1-33.] (FN2) Frank Stevenson actually extended the graph of A330547, but the graphs of A330545 and A330547 are essentially the same.