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.

A345654 Numbers with five neighboring primes on the hexagonal spiral board of odd numbers.

This page as a plain text file.
%I A345654 #13 Jul 01 2021 23:44:24
%S A345654 1,15,45,63,165,195,231,459,693,909,969,1299,1785,2709,3699,4131,4449,
%T A345654 5145,7041,8541,10209,16065,20355,22569,27489,28299,38151,47745,49365,
%U A345654 49959,58479,77619,81021,84651,87555,92625,101115,104181,107271,107349,108225
%N A345654 Numbers with five neighboring primes on the hexagonal spiral board of odd numbers.
%C A345654 All terms in this sequence are composites.
%C A345654 Conjecture: This sequence is infinite and, except 1 and 15, all terms appear in the region between 6*k^2-16*k+11 and 6*k^2-14*k+9 or between 6*k^2-10*k+5 and 6*k^2-8*k+3, where k (>= 1) is the layer number on the hexagonal board.
%C A345654 If the conjecture is true, twin prime conjecture follows.
%e A345654 1 is a term because five of its six neighbors (3, 5, 7, 9, 11, and 13) are primes;
%e A345654 45 is a term because five of its six neighbors (17, 19, 43, 47, 83, and 85) are primes.
%e A345654 A hexagonal spiral board of odd numbers <= 169 is illustrated in the figure below, where terms in the sequence are shown in square brackets and primes in parentheses.
%e A345654 .
%e A345654                  (151)<(149)<-147<--145<--143<--141
%e A345654                    /                               \
%e A345654                   /                                 \
%e A345654                153   (97)<--95<---93<---91<--(89) (139)
%e A345654                 /     /                         \     \
%e A345654                /     /                           \     \
%e A345654             155    99    55<--(53)<--51<---49    87  (137)
%e A345654              /     /     /                   \     \     \
%e A345654             /     /     /                     \     \     \
%e A345654         (157) (101)   57    25<--(23)<--21   (47)   85   135
%e A345654           /     /     /     /             \     \     \     \
%e A345654          /     /     /     /               \     \     \     \
%e A345654       159  (103)  (59)   27    (7)<--(5)  (19)  [45]  (83)  133
%e A345654        /     /     /     /     /       \     \     \     \     \
%e A345654       /     /     /     /     /         \     \     \     \     \
%e A345654    161   105   (61)  (29)    9    [1]-->(3)  (17)  (43)   81  (131)
%e A345654       \     \     \     \     \               /     /     /     /
%e A345654        \     \     \     \     \             /     /     /     /
%e A345654      (163) (107)  [63]  (31)  (11)->(13)->[15]  (41)  (79)  129
%e A345654          \     \     \     \                     /     /     /
%e A345654           \     \     \     \                   /     /     /
%e A345654         [165] (109)   65    33--->35-->(37)-->39    77  (127)
%e A345654             \     \     \                           /     /
%e A345654              \     \     \                         /     /
%e A345654            (167)  111   (67)-->69-->(71)->(73)-->75   125
%e A345654                \     \                                 /
%e A345654                 \     \                               /
%e A345654                169  (113)->115-->117-->119-->121-->123
%o A345654 (Python)
%o A345654 from sympy import isprime; from math import sqrt, ceil
%o A345654 def neib(m):
%o A345654     if m == 1: L = [3, 5, 7, 9, 11, 13]
%o A345654     elif m == 3: L = [17, 19, 5, 1, 13, 15]
%o A345654     else:
%o A345654         L = [m for i in range(6)]; n = int(ceil((3+sqrt(6*m+3))/6))
%o A345654         a0=6*n*n-18*n+15; a1=6*n*n-16*n+11; a2=6*n*n-14*n+9; a3=6*n*n-12*n+7; a4=6*n*n-10*n+5; a5=6*n*n-8*n+3; a6=6*n*n-6*n+1
%o A345654         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 A345654         L[0] += 12*n-10 if p<=4 else -2 if p<=6 else -12*n+16 if p<=9 else 2
%o A345654         L[1] += 2 if p<=1 else 12*n-8 if p<=6 else -2 if p<=8 else -12*n+14
%o A345654         L[2] += -12*n+24 if p<=1 else 2 if p<=3 else 12*n-6 if p<=8 else -2 if p<=10 else -12*n+12
%o A345654         L[3] += -2 if p==0 else -12*n+22 if p<=3 else 2 if p<=5 else 12*n-4 if p<=10 else -2
%o A345654         L[4] += 12*n-14 if p==0 else -2 if p<=2 else -12*n+20 if p<=5 else 2 if p<=7  else 12*n-2
%o A345654         L[5] += 12*n-12 if p<=2 else -2 if p<=4 else -12*n+18  if p<=7 else 2 if p<=9  else 12*n
%o A345654     return L
%o A345654 for i in range(1, 60000):
%o A345654     m = 2*i-1; L1 = [neib(m)[j] for j in range(6)]
%o A345654     if sum(isprime(k) for k in L1) == 5: print(m)
%Y A345654 Cf. A341542.
%K A345654 nonn
%O A345654 1,2
%A A345654 _Ya-Ping Lu_, Jun 21 2021