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.

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.

Original entry on oeis.org

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

Views

Author

Ya-Ping Lu, Dec 28 2024

Keywords

Comments

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.
Conjecture: no prime appears on the negative y-axis.

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.
		

Crossrefs

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.