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.

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.