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.
%I A379643 #29 Jun 22 2025 22:00:56 %S A379643 0,1,1,0,1,1,1,2,1,1,0,0,0,1,0,0,1,1,2,1,1,0,1,1,1,1,0,1,1,1,0,1,1,2, %T A379643 2,1,1,2,1,1,2,2,1,1,1,0,1,0,1,1,1,0,0,1,1,0,0,-1,-1,-1,0,0,1,0,0,0,1, %U A379643 1,2,2,2,1,0,0,1,0,0,0,0,0,1,1,0,0,-1,0 %N A379643 List of x coordinates of prime numbers in a Cartesian grid, where the first prime 2 is placed at the origin (0,0) and the second prime 3 at (1,0). For the n-th prime prime(n), n >= 3, take a unit step in the direction (prime(n)-3)*45 degrees counterclockwise from the positive x-axis. %C A379643 Most of the primes show up in the first and second quadrants (see Links). a(30733704), located at (-390, -1), is the first appearance in the third quadrant and a(1531917197), located at (3807, -1), in the fourth quadrant. The corresponding y coordinates are given in A379731. %C A379643 Conjecture: no prime appears on the negative y-axis. %H A379643 Ya-Ping Lu, <a href="/A379643/a379643.pdf">Positions of the first one million primes</a> %H A379643 Ya-Ping Lu, <a href="/A379643/a379643.txt">x and y coordinates of the first 1 million primes</a> %F A379643 a(n) = pi_{8,3}(p_n) - pi_{8,7}(p_n), where pi_{m,b}(x) is the number of primes <= x which are congruent to b (mod m) and p_n the n-th prime. %e A379643 a(1) = 0 and a(2) = 1, because by definition the (x, y) coordinates of prime(1) and prime(2) are (0,0) and (1,0). For a(10), taking one unit from the position of prime(9), which is (1,1), in the direction (prime(10)-3)*45 = (29-3)*45 = 1170 degrees counterclockwise from the positive x-axis reaches (1,2), or a(10) = 1. Positions of primes up to one million are illustrated in Links. %o A379643 (Python) %o A379643 from sympy import nextprime; R = [0, 1]; x, p = 1, 3 %o A379643 for _ in range(84): %o A379643 p = nextprime(p); d = (5 - p%8)//2 %o A379643 if d in {-1,1}: x += d %o A379643 R.append(x) %o A379643 print(*R, sep = ', ') %Y A379643 Cf. A277730, A297447, A297448, A345293, A379731. %K A379643 sign %O A379643 1,8 %A A379643 _Ya-Ping Lu_, Dec 28 2024