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.

A299207 Length of longest run of primes in any of the four diagonals starting from the center of a square number spiral with prime(n) at the center.

This page as a plain text file.
%I A299207 #29 Apr 20 2018 11:39:51
%S A299207 0,2,3,6,5,2,8,1,4,3,1,8,20,4,3,2,13,1,7,4,1,1,2,3,2,7,1,4,1,0,1,3,6,
%T A299207 0,7,1,1,19,1,2,2,0,4,1,1,0,0,2,8,1,12,3,0,3,2,2,5,1,3,4,0,0,1,7,1,0,
%U A299207 1,0,8,1,2,2,1,1,1,1,1,1,1,0,3,0,7,1,1
%N A299207 Length of longest run of primes in any of the four diagonals starting from the center of a square number spiral with prime(n) at the center.
%H A299207 Robert Price, <a href="/A299207/b299207.txt">Table of n, a(n) for n = 1..10000</a>
%H A299207 Wikipedia, <a href="https://en.wikipedia.org/wiki/Ulam_spiral">Ulam spiral</a>
%H A299207 <a href="/index/Sp">Index entries for sequences related to spirals</a>
%e A299207 For n=1:
%e A299207   +------------------------+
%e A299207   | 18   17   16   15   14 |
%e A299207   |    +--------------+    |
%e A299207   | 19 |  6    5    4 | 13 |
%e A299207   |    |    +----+    |    |
%e A299207   | 20 |  7 |  2    3 | 12 |
%e A299207   |    |    +---------+    |
%e A299207   | 21 |  8    9   10   11 |
%e A299207   |    +-------------------+
%e A299207   | 22   23   24   25   26
%e A299207   +-------------------------
%e A299207 None of the four numbers located on the diagonals in NE, NW, SW or SE direction are prime, so a(1) = 0.
%e A299207 .
%e A299207 For n=2:
%e A299207   +----------------------------------+
%e A299207   | 39   38   37   36   35   34   33 |
%e A299207   |    +------------------------+    |
%e A299207   | 40 | 19   18   17   16   15 | 32 |
%e A299207   |    |    +--------------+    |    |
%e A299207   | 41 | 20 |  7    6    5 | 14 | 31 |
%e A299207   |    |    |     +---+    |    |    |
%e A299207   | 42 | 21 |  8  | 3    4 | 13 | 30 |
%e A299207   |    |    |     +--------+    |    |
%e A299207   | 43 | 22 |  9   10   11   12 | 29 |
%e A299207   |    |    +-------------------+    |
%e A299207   | 44 | 23   24   25   26   27   28 |
%e A299207   |    +-----------------------------+
%e A299207   | 45   46   47   48   49   50   51
%e A299207   +-----------------------------------
%e A299207 The encountered primes are 5 in NE direction, 7, 19, in NW direction and 11 in SE direction, so a(2) = 2.
%e A299207 .
%e A299207 For n=3:
%e A299207   +--------------------------------------------+
%e A299207   | 69   68   67   66   65   64   63   62   61 |
%e A299207   |    +----------------------------------+    |
%e A299207   | 70 | 41   40   39   38   37   36   35 | 60 |
%e A299207   |    |    +------------------------+    |    |
%e A299207   | 71 | 42 | 21   20   19   18   17 | 34 | 59 |
%e A299207   |    |    |    +--------------+    |    |    |
%e A299207   | 72 | 43 | 22 |  9    8    7 | 16 | 33 | 58 |
%e A299207   |    |    |    |    +----+    |    |    |    |
%e A299207   | 73 | 44 | 23 | 10 |  5    6 | 15 | 32 | 57 |
%e A299207   |    |    |    |    +---------+    |    |    |
%e A299207   | 74 | 45 | 24 | 11   12   13   14 | 31 | 56 |
%e A299207   |    |    |    +-------------------+    |    |
%e A299207   | 75 | 46 | 25   26   27   28   29   30 | 55 |
%e A299207   |    |    +-----------------------------+    |
%e A299207   | 76 | 47   48   49   50   51   52   53   54 |
%e A299207   |    +---------------------------------------+
%e A299207   | 77   78   79   80   81   82   83   84   85
%e A299207   +---------------------------------------------
%e A299207 The encountered primes are 7, 17 in NE direction, 11 in SW direction and 13, 29, 53 in SE direction, so a(3) = 3.
%Y A299207 Cf. A215471.
%K A299207 nonn
%O A299207 1,2
%A A299207 _Felix Fröhlich_, Feb 05 2018
%E A299207 Corrected a(3) and diagram for n=3. - _Robert Price_, Apr 02 2018
%E A299207 a(11)-a(85) from _Robert Price_, Apr 02 2018