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.

Showing 1-7 of 7 results.

A307012 Second coordinate in a redundant hexagonal coordinate system of the points of a counterclockwise spiral on an hexagonal grid. First and third coordinates are given in A307011 and A345978.

Original entry on oeis.org

0, 0, 1, 1, 0, -1, -1, -1, 0, 1, 2, 2, 2, 1, 0, -1, -2, -2, -2, -2, -1, 0, 1, 2, 3, 3, 3, 3, 2, 1, 0, -1, -2, -3, -3, -3, -3, -3, -2, -1, 0, 1, 2, 3, 4, 4, 4, 4, 4, 3, 2, 1, 0, -1, -2, -3, -4, -4, -4, -4, -4, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 5, 5, 5, 5, 5, 4
Offset: 0

Views

Author

Hugo Pfoertner, Mar 19 2019

Keywords

Comments

The coordinate system can be described using 3 axes that pass through spiral point 0 and one of points 1, 2 or 3. Along each axis, one of the coordinates is 0. a(n) is the signed distance from spiral point n to the axis that passes through point 1. The distance is measured along either of the lines through point n that are parallel to one of the other 2 axes and the sign is such that point 2 has positive distance. - Peter Munn, Jul 13 2021
We can use this coordinate with the first coordinate to form an oblique coordinate system, in which each coordinate maps to an oblique coordinate vector parallel to the axis along which the other coordinate is 0. See the figure with nonperpendicular axes in the Barile link. When both of these coordinates are positive, the oblique coordinate vectors make a 60-degree angle with each other. [Made more specific by Peter Munn, Jul 19 2021]

Crossrefs

Extensions

Name revised by Peter Munn, Jul 08 2021

A307013 Third coordinate (asymmetric variant) in a redundant hexagonal coordinate system of the points of a counterclockwise spiral on an hexagonal grid. First and second coordinates are given in A307011 and A307012.

Original entry on oeis.org

0, 1, 1, 0, -1, -1, 0, 1, 2, 2, 2, 1, 0, -1, -2, -2, -2, -1, 0, 1, 2, 3, 3, 3, 3, 2, 1, 0, -1, -2, -3, -3, -3, -3, -2, -1, 0, 1, 2, 3, 4, 4, 4, 4, 4, 3, 2, 1, 0, -1, -2, -3, -4, -4, -4, -4, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 5, 5, 5, 5, 5, 4, 3, 2, 1, 0, -1, -2
Offset: 0

Views

Author

Hugo Pfoertner, Mar 19 2019

Keywords

Comments

From Peter Munn, Jul 11 2021: (Start)
The points of the spiral are equally the points of a hexagonal lattice, the points of an isometric (triangular) grid and the center points of the cells of a honeycomb (regular hexagonal tiling or grid). The coordinate system can be described using three "0-axes" that pass through spiral point 0 and one of points 1, 2 or 3. These 0-axes are the lines along which one of the coordinates is 0.
a(n), the 3rd coordinate, is the signed distance from spiral point n to the coordinate's 0-axis, which passes through points 0 and 3. The distance is measured along either of the lines through point n that are parallel to one of the other 2 axes and the sign is such that point 1 has positive distance. This 3rd coordinate is the sum of the other 2. In the symmetric variant of the coordinate system, the 3rd coordinate has the opposite sense, so that the 3 coordinates sum to 0. See A345978.
We can use any 2 of the 3 coordinates to form an oblique coordinate system, in which each of the 2 coordinates specifies vectors parallel to the other coordinate's 0-axis. This means the direction of the oblique coordinate vectors depends on the choice of the other coordinate - see the illustration of coordinate pairing in the links. When both coordinates are positive, an oblique coordinate vector derived from this sequence makes a 120-degree angle with the vector derived from the other sequence; however, when A307011 and A307012 are used together, the angle is 60 degrees.
Pairing with A307012 can be viewed as follows. Let omega = -1/2 + i*sqrt(3)/2, a primitive cube root of unity. Then f(n) = a(n) + omega*A307012(n) embeds the spiral in the complex plane with spiral points 0 and 1 embedded at 0 and 1 (so that the points of the spiral embed as the Eisenstein integers, as used for A345435).
(End)

Crossrefs

A334492 is effectively this "3rd coordinate" for a different sequence of points on a hexagonal lattice.

Formula

a(n) = A307011(n) + A307012(n). - Peter Munn, Jul 04 2021

A307014 List coordinates (x,y) of the points in an hexagonal grid, sorted first by radial coordinate r and in case of ties, by polar angle 0 <= phi < 2*Pi in a polar coordinate system. Sequence gives the first coordinate in a barycentric coordinate system.

Original entry on oeis.org

0, 1, 0, -1, -1, 0, 1, 1, -1, -2, -1, 1, 2, 2, 0, -2, -2, 0, 2, 2, 1, -1, -2, -3, -3, -2, -1, 1, 2, 3, 3, 3, 0, -3, -3, 0, 3, 2, -2, -4, -2, 2, 4, 3, 1, -1, -3, -4, -4, -3, -1, 1, 3, 4, 4, 4, 0, -4, -4, 0, 4, 3, 2, -2, -3, -5, -5, -3, -2, 2, 3, 5, 5, 4, 1
Offset: 0

Views

Author

Hugo Pfoertner, Mar 21 2019

Keywords

Comments

Cartesian coordinates (x,y) of the grid points are converted to barycentric coordinates (i,j,k) by i = x - y/sqrt(3), j = 2*y/sqrt(3), k = x + y/sqrt(3). The sequence gives i. j is given in A307016, k is given in A307017.
The sorting by polar angle affects the grid points in the shells of size A035019, starting at indices given by A038590.

Crossrefs

Programs

  • PARI
    \\ See Link
    \\ To create the data of this sequence load program from file and call
    a307014_16(5, 4) \\ Hugo Pfoertner, Nov 07 2023

A328818 2 * x-coordinate of the points of a counterclockwise spiral on an hexagonal grid.

Original entry on oeis.org

0, 2, 1, -1, -2, -1, 1, 3, 4, 3, 2, 0, -2, -3, -4, -3, -2, 0, 2, 4, 5, 6, 5, 4, 3, 1, -1, -3, -4, -5, -6, -5, -4, -3, -1, 1, 3, 5, 6, 7, 8, 7, 6, 5, 4, 2, 0, -2, -4, -5, -6, -7, -8, -7, -6, -5, -4, -2, 0, 2, 4, 6, 7, 8, 9, 10, 9, 8, 7, 6, 5, 3, 1, -1, -3, -5, -6, -7, -8, -9, -10, -9, -8, -7, -6, -5, -3, -1
Offset: 0

Views

Author

Hugo Pfoertner, Oct 28 2019

Keywords

Comments

The Cartesian coordinates of the points of a counterclockwise spiral on an hexagonal grid are given by x(n) = a(n)/2 and by y(n)= A307012(n) * sqrt(3)/2.

Crossrefs

Formula

a(n) = A307011(n) + A307013(n).

A346721 Use the cells of a hexagonal grid to represent the algebraic integers in the integer ring of Q(sqrt(-7)), as explained in the comments. Number the cells along the counterclockwise hexagonal spiral that starts with cells 0 and 1 representing integers 0 and 1. List the cells that represent 0 or a prime in the ring.

Original entry on oeis.org

0, 2, 3, 5, 6, 11, 17, 19, 21, 23, 28, 30, 32, 45, 47, 57, 59, 61, 63, 65, 67, 69, 76, 78, 80, 82, 84, 103, 107, 121, 125, 127, 129, 131, 135, 137, 139, 148, 150, 152, 156, 158, 160, 187, 189, 211, 213
Offset: 1

Views

Author

Peter Munn, Jul 30 2021

Keywords

Comments

In this entry we use "rational integers" to refer to integers in their usual sense as whole numbers - they form a subset of the algebraic integers that form the ring, which we denote "R".
The algebraic integers in R (the elements of R) are specifically quadratic integers of the form z = x + y*sqrt(-7) or z = (x+0.5) + (y+0.5)*sqrt(-7) where x and y are rational integers. Plotted as points on a plane, they can be joined in a grid of isosceles triangles or be seen as the center points of hexagonal regions. When the latter are adjusted to make them regular, it makes for appealing diagrams, which we will come to shortly.
(To be precise, we map each element, z, to the region of the complex plane containing the points that have z as their nearest ring element, then map these (hexagonal) regions continuously to the cells of a (regular) hexagonal grid.)
R is one of 9 related rings that are unique factorization domains, meaning their elements factorize into prime elements in a unique way, just as with rational integers and prime numbers. See the Wikipedia link or the Stark reference, for example.
This set of sequences is inspired by tilings: see the Wichmann link. Each tiling represents one of the 9 rings and shows the primes as distinctively colored squares or hexagons as appropriate.
General properties of the related hexagonal spiral sequences: (Start)
R is one of 7 rings where hexagons are appropriate. Each has elements of the form x + y*sqrt(-p) and (x+0.5) + (y+0.5)*sqrt(-p), where p is a (rational) prime congruent to 3 modulo 4.
When mapping the grid cells to quadratic integers, it is often convenient to write the latter as a + w*b, where w = 0.5*(1+sqrt(-p)). Cell m on the spiral represents A307011(m) + w*A307012(m).
We can find the primes without advanced mathematics, using multiplication formulas and a sieve as explained below.
w^2 = w - c, where c = (p+1)/4 (which is an integer as p == 3 (mod 4)). So, in general, the product of a_1 + w*b_1 and a_2 + w*b_2 is (a_1*a_2 - c*b_1*b_2) + w*(a_1*b_2 + a_2*b_1 + b_1*b_2). The norm (absolute square) of a + w*b is a^2 + a*b + c*b^2.
For k >= 1, the algebraic integers represented by cells numbered 3k*(k-1)+1 to 3k*(k+1) on the spiral (cells A003215(k-1) to A028896(k)) are positioned along a hexagon in the complex plane; they include rational integers k and -k, and have norms in the range [k^2*(4c-1)/4c, k^2*c] = [k^2*p/(p+1), k^2*c].
To determine the primes we may list the ring elements in an order such that they have nondecreasing norm, and use a sieve to remove the products of nonunits. So, we are only interested in elements with norm greater than 1 (i.e. nonzero, nonunit). At each round of sieving we note the first element, z, whose products we have not yet removed, and remove in turn the product of z and each element from z onwards in the list.
(End)

Examples

			Table showing derivation of initial terms.
The ring element, z, represented by spiral cell m is shown in the form A307011(m) + A307012(m)*w, where w = 0.5*(1+sqrt(-7)).
The column headed "(x,y)" gives x and y when z is written in the form z = x + y*sqrt(-7).
      A307011(m)
       |  A307012(m)
   m   |   |      z      (x,y)      status         n  a(n)=m
       |   |
   0   0   0      0   ( 0.0, 0.0)     zero         1    0
   1   1   0      1   ( 1.0, 0.0)     unit
   2   0   1      w   ( 0.5, 0.5)    prime         2    2
   3  -1   1   -1+w   (-0.5, 0.5)    prime         3    3
   4  -1   0     -1   (-1.0, 0.0)     unit
   5   0  -1     -w   (-0.5,-0.5)    prime         4    5
   6   1  -1    1-w   ( 0.5,-0.5)    prime         5    6
   7   2  -1    2-w   ( 1.5,-0.5)  =    -w*w
   8   2   0      2   ( 2.0, 0.0)  = (1-w)*w
   9   1   1    1+w   ( 1.5, 0.5)  = (1-w)*(w-1)
  10   0   2     2w   ( 1.0, 1.0)  =     2*w
  11  -1   2  -1+2w   ( 0.0, 1.0)    prime         6   11
		

References

  • L. W. Reid, The Elements of the Theory of Algebraic Numbers, MacMillan, NY, 1910.
  • H. M. Stark, An Introduction to Number Theory. Markham, Chicago, 1970; Theorem 8.22 on page 295 lists the nine UFDs of the form Q(sqrt(-d)), cf. A003173.

Crossrefs

Cf. A003173.
Norms of primes in R: A090348.
Sequences related to the geometry of the spiral: A003215, A028896, A307011, A307012, A345764.
Equivalent sequences for other Q(sqrt(D)): A345436 (D=-1), A345437 (D=-2), A345435 (D=-3), A346722 (D=-11), A346723 (D=-19), A346724 (D=-43), A346725 (D=-67), A346726 (D=-163).

Formula

m is a term if and only if A345764(m) is a term.

A345978 Third coordinate of the points of a counterclockwise spiral on an hexagonal grid in a symmetric redundant hexagonal coordinate system.

Original entry on oeis.org

0, -1, -1, 0, 1, 1, 0, -1, -2, -2, -2, -1, 0, 1, 2, 2, 2, 1, 0, -1, -2, -3, -3, -3, -3, -2, -1, 0, 1, 2, 3, 3, 3, 3, 2, 1, 0, -1, -2, -3, -4, -4, -4, -4, -4, -3, -2, -1, 0, 1, 2, 3, 4, 4, 4, 4, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, -5, -5, -5, -5, -5, -4, -3, -2, -1, 0, 1, 2
Offset: 0

Views

Author

Hugo Pfoertner, Jul 15 2021

Keywords

Comments

This is a negated version of A307013 with the advantage of symmetry, i.e., A307011(n) + A307012(n) + a(n) = 0. The mutual angles of the 3 coordinate axes then are 120 or 240 degrees.
From Peter Munn, Jul 18 2021: (Start)
The coordinate system can be described using 3 axes that pass through spiral point 0 and one of points 1, 2 or 3. Along each axis, one of the coordinates is 0. a(n) is the signed distance from spiral point n to the axis that passes through point 3. The distance is measured along either of the lines through point n that are parallel to one of the other 2 axes and the sign is such that point 1 has negative distance.
The coordinates may be used in 2 ways. Firstly, any 2 of the 3 coordinates can be paired as oblique coordinates, which entails mapping each coordinate to a vector that is parallel to the line along which the other coordinate is 0 (described further in A307012). Alternatively, each of the 3 coordinates is mapped to a vector perpendicular to the line along which the coordinate is 0, then the sum of the vectors is divided by the square root of 3.
This coordinate system has been used for more than half a century. See the extract from Moffatt, Pearsall and Wulff included in the linked Princeton MAE page (which refers to a 4th coordinate, making it a 3D system). "Cube coordinates" appears to be a currently popular term for the system in some information technology communities. This refers to the useful isometric view of the cubic cells from a 3 dimensional lattice that are indexed by 3 coordinates that sum to zero.
(End)

References

  • William G Moffatt, George W Pearsall and John Wulff, The Structure and Properties of Materials Volume I: Structure, Wiley, 1964.

Crossrefs

Formula

a(n) = -A307013(n) = -(A307011(n) + A307012(n)).

Extensions

Name revised by Peter Munn, Jul 22 2021

A354947 Number of primes adjacent to prime(n) in a hexagonal spiral of positive integers.

Original entry on oeis.org

2, 2, 0, 2, 1, 1, 0, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 2, 0, 1, 0, 0, 0, 0, 0, 2, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0
Offset: 1

Views

Author

Wade Reece Eberly, Sep 23 2022

Keywords

Examples

			The spiral begins
      13--12--11
      /         \
    14   4---3  10
    /   /     \   \
  15   5   1---2   9
    \   \         /
    16   6---7---8
      \
      17--18--19--...
For n=4, prime(4) = 7 in the spiral has a(4) = 2 primes adjacent (2 and 19).
		

Crossrefs

Cf. A307011, A307013 (spiral coordinates), A056105 (spiral first spoke).
Showing 1-7 of 7 results.