The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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. 2
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, 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, 1, 0, 8, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 0, 3, 0, 7, 1, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
Wikipedia, Ulam spiral
EXAMPLE
For n=1:
+------------------------+
| 18 17 16 15 14 |
| +--------------+ |
| 19 | 6 5 4 | 13 |
| | +----+ | |
| 20 | 7 | 2 3 | 12 |
| | +---------+ |
| 21 | 8 9 10 11 |
| +-------------------+
| 22 23 24 25 26
+-------------------------
None of the four numbers located on the diagonals in NE, NW, SW or SE direction are prime, so a(1) = 0.
.
For n=2:
+----------------------------------+
| 39 38 37 36 35 34 33 |
| +------------------------+ |
| 40 | 19 18 17 16 15 | 32 |
| | +--------------+ | |
| 41 | 20 | 7 6 5 | 14 | 31 |
| | | +---+ | | |
| 42 | 21 | 8 | 3 4 | 13 | 30 |
| | | +--------+ | |
| 43 | 22 | 9 10 11 12 | 29 |
| | +-------------------+ |
| 44 | 23 24 25 26 27 28 |
| +-----------------------------+
| 45 46 47 48 49 50 51
+-----------------------------------
The encountered primes are 5 in NE direction, 7, 19, in NW direction and 11 in SE direction, so a(2) = 2.
.
For n=3:
+--------------------------------------------+
| 69 68 67 66 65 64 63 62 61 |
| +----------------------------------+ |
| 70 | 41 40 39 38 37 36 35 | 60 |
| | +------------------------+ | |
| 71 | 42 | 21 20 19 18 17 | 34 | 59 |
| | | +--------------+ | | |
| 72 | 43 | 22 | 9 8 7 | 16 | 33 | 58 |
| | | | +----+ | | | |
| 73 | 44 | 23 | 10 | 5 6 | 15 | 32 | 57 |
| | | | +---------+ | | |
| 74 | 45 | 24 | 11 12 13 14 | 31 | 56 |
| | | +-------------------+ | |
| 75 | 46 | 25 26 27 28 29 30 | 55 |
| | +-----------------------------+ |
| 76 | 47 48 49 50 51 52 53 54 |
| +---------------------------------------+
| 77 78 79 80 81 82 83 84 85
+---------------------------------------------
The encountered primes are 7, 17 in NE direction, 11 in SW direction and 13, 29, 53 in SE direction, so a(3) = 3.
CROSSREFS
Cf. A215471.
Sequence in context: A011159 A359623 A091556 * A277330 A072298 A130686
KEYWORD
nonn
AUTHOR
Felix Fröhlich, Feb 05 2018
EXTENSIONS
Corrected a(3) and diagram for n=3. - Robert Price, Apr 02 2018
a(11)-a(85) from Robert Price, Apr 02 2018
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 16 14:39 EDT 2024. Contains 372554 sequences. (Running on oeis4.)