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.
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, 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, 1, 2, 2, 2, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, -1, 0
Offset: 1
Keywords
Examples
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.
Links
- Ya-Ping Lu, Positions of the first one million primes
- Ya-Ping Lu, x and y coordinates of the first 1 million primes
Programs
-
Python
from sympy import nextprime; R = [0, 1]; x, p = 1, 3 for _ in range(84): p = nextprime(p); d = (5 - p%8)//2 if d in {-1,1}: x += d R.append(x) print(*R, sep = ', ')
Formula
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.
Comments