A302244 Length of longest run of primes in any of the four diagonals starting from the center of a square number spiral with n at the center.
1, 3, 0, 2, 0, 3, 0, 6, 0, 1, 0, 5, 0, 2, 0, 2, 0, 8, 0, 1, 0, 1, 0, 4, 0, 4, 0, 2, 0, 3, 0, 1, 0, 1, 0, 3, 0, 8, 0, 1, 0, 20, 0, 4, 0, 1, 0, 3, 0, 1, 0, 1, 0, 2, 0, 2, 0, 2, 0, 13, 0, 1, 0, 2, 0, 3, 0, 7, 0, 1, 0, 4, 0, 1, 0, 1, 0, 3, 0, 1, 0, 1, 0, 2, 0, 2
Offset: 0
Keywords
Examples
For n=3: +-------------------------------+ | 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 7, 19 in the NW direction, 5 in the NE direction and 11 in the SE direction, so a(3) = 2.
Links
- Robert Price, Table of n, a(n) for n = 0..10000
- Wikipedia, Ulam spiral
- Index entries for sequences related to spirals
Comments