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-6 of 6 results.

A345436 Represent the ring of Gaussian integers E = {x+y*i: x, y rational integers, i = sqrt(-1)} by the cells of a square grid; number the cells of the grid along a counterclockwise square spiral, with the cells representing the ring identities 0, 1 numbered 0, 1. Sequence lists the index numbers of the cells which are 0 or a prime in E.

Original entry on oeis.org

0, 2, 4, 6, 8, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 51, 53, 59, 61, 67, 69, 75, 77, 81, 83, 87, 89, 91, 93, 97, 99, 101, 103, 107, 109, 111, 113, 117, 119, 121, 125, 127, 131, 133, 137, 139, 143, 145, 149, 151, 155, 157
Offset: 1

Views

Author

N. J. A. Sloane, Jun 23 2021

Keywords

Comments

The cell with spiral index m represents the Gaussian integer A174344(m+1) + A274923(m+1) * i. So the set of Gaussian primes is {A174344(a(n)+1) + A274923(a(n)+1) * i : n >= 2}. - Peter Munn, Aug 02 2021
The Gaussian integer z = x+i*y has norm x^2+y^2. There are four units (of norm 1), +-1, +-i. The number of Gaussian integers of norm n is A004018(n).
The norms of the Gaussian primes are listed in A055025, and the number of primes with a given norm is given in A055026.
The successive norms of the Gaussian integers along the square spiral are listed in A336336.

References

  • J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag; Table 4.2, p. 106.
  • L. W. Reid, The Elements of the Theory of Algebraic Numbers, MacMillan, NY, 1910, see Chap. V.
  • 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

Extensions

Name clarified by Peter Munn, Aug 02 2021

A359058 a(n) = squared distance to the origin of the n-th vertex on a counterclockwise undulating spiral in a square grid.

Original entry on oeis.org

0, 1, 2, 1, 4, 5, 2, 5, 4, 1, 2, 1, 4, 5, 2, 5, 4, 9, 10, 5, 8, 5, 10, 9, 16, 17, 10, 13, 8, 13, 10, 17, 16, 9, 10, 5, 8, 5, 10, 9, 16, 17, 10, 13, 8, 13, 10, 17, 16, 25, 26, 17, 20, 13, 18, 13, 20, 17, 26, 25, 36, 37, 26, 29, 20, 25, 18, 25, 20, 29, 26, 37, 36, 25, 26, 17, 20, 13, 18, 13, 20
Offset: 0

Views

Author

Hans G. Oberlack, Dec 14 2022

Keywords

Comments

The spiral coordinates are A359216 and A359217.

Examples

			The spiral begins as follows and for instance point n=7 is at x=-2,y=1 so that a(7) = (-2)^2 + 1^2 = 5.
   y ^
     |
   4 |             17--16
     |              |   |
   3 |         13--10   9--10
     |          |           |
   2 |     13---8   5---4   5---8
     |      |       |   |       |
   1 | 17--10   5---2   1---2   5--10
     |  |       |           |       |
   0 | 16---9   4---1   0---1   4---9
     |      |       |           |       |
  -1 |     10---5   2---1   2---5  10--17
     |          |       |   |       |
  -2 |          8---5   4---5   8--13
     |              |           |
  -3 |             10---9  10--13
     |                  |   |
  -4 |                 16--17
     +------------------------------------>
       -4  -3  -2  -1   0   1   2   3   4 x
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

a(n) = A359216(n)^2 + A359217(n)^2.

A345439 Consider the Eisenstein integers x + y*omega, x and y rational integers, represented as the cells of an hexagonal grid; draw a hexagonal spiral as in A345435; a(n) is the norm x^2-x*y+y^2 of the Eisenstein integer in the n-th cell of the spiral.

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 1, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 7, 7, 9, 7, 7, 9, 7, 7, 9, 7, 7, 9, 7, 7, 9, 7, 7, 9, 13, 12, 13, 16, 13, 12, 13, 16, 13, 12, 13, 16, 13, 12, 13, 16, 13, 12, 13, 16, 13, 12, 13, 16, 21, 19, 19, 21, 25, 21, 19, 19, 21, 25, 21, 19, 19
Offset: 0

Views

Author

N. J. A. Sloane, Jun 25 2021

Keywords

Crossrefs

Programs

  • PARI
    See Links section.

Extensions

More terms from Rémy Sigrist, Jun 26 2021

A335298 a(n) is the squared distance between the points P(n) and P(0) on a plane, n >= 0, such that the distance between P(n) and P(n+1) is n+1 and, going from P(n) to P(n+2), a 90-degree left turn is taken in P(n+1).

Original entry on oeis.org

0, 1, 5, 8, 8, 13, 25, 32, 32, 41, 61, 72, 72, 85, 113, 128, 128, 145, 181, 200, 200, 221, 265, 288, 288, 313, 365, 392, 392, 421, 481, 512, 512, 545, 613, 648, 648, 685, 761, 800, 800, 841, 925, 968, 968, 1013, 1105, 1152, 1152, 1201, 1301, 1352, 1352, 1405, 1513
Offset: 0

Views

Author

Gerhard Kirchner, Jun 28 2020

Keywords

Comments

P(n) is a corner on a spiral like this:
* * * * * * * * * * * *
*
* * * * * * * * *
* * *
* * * * * * *
* * * * *
* * * * * *
* * * *
* * * * * * * *
* *
* * * * * * * * * *
If we interpret the pointer from P(0) to P(n) as a complex number z(n), the description of the spiral is short because a 90-degree left turn is a multiplication by i (imaginary unit) and the distance of P(n) from P(0) is abs(z(n))^2, see formula 1.

Examples

			  n  n*i^(n-1)  z(n)  a(n)
------------------------------------
  0     0        0     0
  1     1        1     1
  2     2i      1+2i   5 = 1^2 + 2^2
  3    -3      -2+2i   8 = 2^2 + 2^2
  4    -4i     -2-2i   8
  5     5       3-2i  13 = 3^2 + 2^2
  6     6i      3+4i  25 = 3^2 + 4^2
		

Crossrefs

Programs

  • Mathematica
    z[0]=0; z[n_]:=z[n-1]+n*I^(n-1); a[n_]:=z[n]*Conjugate[z[n]]; Array[a,55,0] (* Stefano Spezia, Jun 28 2020 *)

Formula

a(n) = abs(z(n))^2 with
1) z(n) = z(n-1)+n*i^(n-1), z(0)=0. (recursive)
2) z(n) = i/2*(n*i^(n+1)-(n+1)*i^n+1). (explicit)
Without complex numbers for k >= 0:
a(4*k) = 8*k^2,
a(4*k+1) = 8*k^2+4*k+1,
a(4*k+2) = 8*k^2+12*k+5,
a(4*k+3) = 8*(k+1)^2.
From Stefano Spezia, Jun 28 2020: (Start)
G.f.: x*(1 + 2*x - 2*x^2 + 2*x^3 + x^4)/((1 - x)^3*(1 + x^2)^2).
a(n) = 3*a(n-1) - 5*a(n-2) + 7*a(n-3) - 7*a(n-4) + 5*a(n-5) - 3*a(n-6) + a(n-7) for n > 6. (End)

A336335 a(n) is the index of the first occurrence of the Euclidean distance prime(n) from a point on a square spiral to its starting point at 1.

Original entry on oeis.org

11, 28, 50, 176, 452, 536, 848, 1388, 2048, 1682, 3752, 4784, 6272, 7268, 8696, 7938, 13748, 14210, 17756, 19952, 11888, 24728, 27308, 25322, 20456, 38888, 42128, 45476, 32792, 49826, 64136, 68252, 43698, 76868, 77930, 90752, 69216, 105788, 111056, 108354, 127628
Offset: 1

Views

Author

Hugo Pfoertner, Jul 24 2020

Keywords

Examples

			  37--36--35--34--33--32--31
   |                       |
  38  17--16--15--14--13  30  ...
   |   |               |   |   |
  39  18   5---4---3  12  29  54
   |   |   |       |   |   |   |
  40  19   6   1---2 d=2 d=3  53
   |   |   |           |   |   |
  41  20   7---8---9--10  27  52
   |   |                   |   |
  42  21--22--23--24--25--26  51
   |                           |
  43--44--45--46--47--48--49-d=5
.
a(1) = 11 is the index of the first occurrence of distance d = 2 = prime(1) from the start of the spiral.
a(2) = 28 is the index of the first occurrence of distance d = 3 = prime(2) from the start of the spiral.
Distances of the form 4*k+1 corresponding to Pythagorean primes A002144 occur earlier than on the East spoke of the square spiral, dependent on the decomposition of p^2 into two squares. prime(3)^2 = 4^2 + 3^2 leads to index a(3) = 50 in the spiral.
		

Crossrefs

Formula

a(n) = A054552(prime(n)) if prime(n) != 1 mod 4.

A345440 Represent the ring R = {x+y*sqrt(-2): x, y rational integers} by the cells centered at the points (x,y) of a square grid, as in A345437; number the cells of the grid along a counterclockwise square spiral, with the cells at (0,0) and (1,0) numbered 0, 1; then a(n) is the norm x^2+2*y^2 of the element of R occupying the n-th cell.

Original entry on oeis.org

0, 1, 3, 2, 3, 1, 3, 2, 3, 6, 4, 6, 12, 9, 8, 9, 12, 6, 4, 6, 12, 9, 8, 9, 12, 17, 11, 9, 11, 17, 27, 22, 19, 18, 19, 22, 27, 17, 11, 9, 11, 17, 27, 22, 19, 18, 19, 22, 27, 34, 24, 18, 16, 18, 24, 34, 48, 41, 36, 33, 32, 33, 36, 41, 48, 34, 24, 18, 16, 18, 24
Offset: 0

Views

Author

N. J. A. Sloane, Jun 25 2021

Keywords

Crossrefs

Programs

  • PARI
    See Links section.

Formula

a(n) = A174344(n+1)^2 + 2*A274923(n+1)^2. - Rémy Sigrist, Jun 26 2021

Extensions

More terms from Rémy Sigrist, Jun 26 2021
Showing 1-6 of 6 results.