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.

A344481 Isolated single primes enclosed by four composites on square spiral board of odd numbers.

This page as a plain text file.
%I A344481 #6 Jun 24 2021 21:38:04
%S A344481 97,157,233,257,293,307,331,337,359,367,389,397,409,439,449,479,487,
%T A344481 499,503,563,607,613,631,653,677,683,691,709,727,743,751,761,773,853,
%U A344481 863,887,907,911,929,937,967,971,983,1013,1069,1087,1117,1181,1187,1193,1201
%N A344481 Isolated single primes enclosed by four composites on square spiral board of odd numbers.
%H A344481 Ya-Ping Lu, <a href="/A344481/a344481.pdf">Illustration of isolated single primes on square spiral board</a>
%e A344481 3 is not a term because two of the four neighbors (1, 5, 17 and 21) are primes.
%e A344481 97 is a term because 97 is a prime and all four neighbors (51, 95, 99 and 159) are composites (see the illustration in Links).
%o A344481 (Python)
%o A344481 from sympy import prime, isprime; from math import sqrt, ceil
%o A344481 def neib(m):
%o A344481     n = int(ceil((sqrt(m)+1.0)/2.0)); L = [m,m,m,m]
%o A344481     z1=4*n*n-12*n+10;z2=4*n*n-10*n+7;z3=4*n*n-8*n+5;z4=4*n*n-6*n+3;z5=4*n*n-4*n+1
%o A344481     L[0]+=1 if m<z2 else 8*n-5 if m<=z3 else -1 if m<=z4 else -8*n+9
%o A344481     L[1]+=-1 if m==z1 else -8*n+15 if m<z2 else 1 if m<z3 else 8*n-3 if m<=z4 else -1
%o A344481     L[2]+=8*n-9 if m==z1 else -1 if m<=z2 else -8*n+13 if m<z3 else i if m<z4 else 8*n-1
%o A344481     L[3]+=8*n-7 if m<=z2 else -1 if m<=z3 else -8*n+11 if m<z4 else 1
%o A344481     return L
%o A344481 for i in range(2, 200):
%o A344481     p = prime(i); L1 = [2*neib(int((p+1)/2))[j]-1 for j in range(4)]
%o A344481     if sum(isprime(k) for k in L1) == 0: print(p)
%Y A344481 Cf. A341542.
%K A344481 nonn
%O A344481 1,1
%A A344481 _Ya-Ping Lu_, May 20 2021