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.

A346948 Isolated single primes enclosed by six composites on hexagonal spiral board of odd numbers.

This page as a plain text file.
%I A346948 #9 Oct 03 2021 19:20:20
%S A346948 211,257,277,331,509,563,587,647,653,673,683,709,751,757,839,853,919,
%T A346948 983,997,1087,1117,1123,1163,1283,1433,1447,1493,1531,1579,1637,1733,
%U A346948 1777,1889,1913,1973,1993,2179,2207,2251,2273,2287,2333,2357,2399,2447,2467
%N A346948 Isolated single primes enclosed by six composites on hexagonal spiral board of odd numbers.
%C A346948 It seems that more isolated primes, m, appear in regions 6*k^2-16*k+13 <= m <= 6*k^2-14*k+7 and 6*k^2-10*k+7 <= m <= 6*k^2-8*k+1 than the other 4 regions, where k (>= 1) is the layer number on the hexagonal board, which is illustrated in A345654.
%C A346948 Numbers of prime terms appearing in the 6 regions and 6 arms of a 10000-layer hexagonal board, with the 299970001 odd numbers up to 599940001, are:
%C A346948                Region               Appearance          Arm         Appearance
%C A346948 ----------------------------------  ----------   -----------------  ----------
%C A346948 6*k^2-18*k+15 <= m <= 6*k^2-16*k+9   2681490     m = 6*k^2-16*k+11      692
%C A346948 6*k^2-16*k+13 <= m <= 6*k^2-14*k+7   3192576     m = 6*k^2-14*k+ 9      551
%C A346948 6*k^2-14*k+11 <= m <= 6*k^2-12*k+5   2681571     m = 6*k^2-12*k+ 7      671
%C A346948 6*k^2-12*k+ 9 <= m <= 6*k^2-10*k+3   2681254     m = 6*k^2-10*k+ 5      545
%C A346948 6*k^2-10*k+ 7 <= m <= 6*k^2- 8*k+1   3191045     m = 6*k^2- 8*k+ 3      721
%C A346948 6*k^2- 8*k+ 5 <= m <= 6*k^2- 6*k-1   2680620     m = 6*k^2- 6*k+ 1     1040
%e A346948 3 is not a term because four of the six neighbors (1, 5, 13, 15, 17 and 19) are primes.
%e A346948 211 is a term because 211 is a prime and all six neighbors (145, 147, 209, 213, 287 and 289) are composites.
%o A346948 (Python)
%o A346948 from sympy import isprime; from math import sqrt, ceil
%o A346948 def neib(m):
%o A346948     if m == 1: return [3, 5, 7, 9, 11, 13]
%o A346948     if m == 3: return [17, 19, 5, 1, 13, 15]
%o A346948     L = [m for i in range(6)]; n = int(ceil((3+sqrt(6*m + 3))/6)); x=6*n*n; y=12*n
%o A346948     a0 = x-18*n+15; a1 =x-16*n+11; a2 =x-14*n+9
%o A346948     a3 = x-y+7; a4 =x-10*n+5; a5 =x-8*n+3; a6 =x-6*n+1
%o A346948     p = 0 if m==a0 else 1 if m>a0 and m<a1 else 2 if m==a1 else 3 if m>a1 and m<a2 else 4 if m==a2 else 5 if m>a2 and m<a3 else 6 if m==a3 else 7 if m>a3 and m<a4 else 8 if m==a4 else 9 if m>a4 and m<a5 else 10 if m==a5 else 11 if m>a5 and m<a6 else 12
%o A346948     L[0] += y-10 if p<=4 else -2 if p<=6 else -y+16 if p<=9 else 2
%o A346948     L[1] += 2 if p<=1 else y-8 if p<=6 else -2 if p<=8 else -y+14
%o A346948     L[2] += -y+24 if p<=1 else 2 if p<=3 else y-6 if p<=8 else -2 if p<=10 else -y+12
%o A346948     L[3] += -2 if p==0 else -y+22 if p<=3 else 2 if p<=5 else y-4 if p<=10 else -2
%o A346948     L[4] += y-14 if p==0 else -2 if p<=2 else -y+20 if p<=5 else 2 if p<=7  else y-2
%o A346948     L[5] += y-12 if p<=2 else -2 if p<=4 else -y+18 if p<=7 else 2 if p<=9  else y
%o A346948     return L
%o A346948 for i in range(1, 1500):
%o A346948     m = 2*i - 1
%o A346948     if isprime(m) == 1:
%o A346948         L1 = [neib(m)[j] for j in range(6)]
%o A346948         if sum(isprime(k) for k in L1) == 0: print(m)
%Y A346948 Cf. A083577, A090687, A176608, A115258, A341542, A344481, A345654.
%K A346948 nonn
%O A346948 1,1
%A A346948 _Ya-Ping Lu_, Aug 08 2021