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.
%I A065092 #66 Jul 28 2025 14:32:14 %S A065092 127,173,191,233,239,251,277,337,349,373,431,443,491,557,653,683,701, %T A065092 733,761,1019,1193,1201,1381,1453,1553,1597,1709,1753,1759,1777,2027, %U A065092 2063,2333,2371,2447,2633,2879,2999,3083,3181,3209,3313,3593,3643,3767,3779,3851 %N A065092 Primes with property that when written in base two complementing any single bit yields a composite number. %C A065092 Also known as singularly dead end primes. %C A065092 In contrast to the primes listed in A137985 (which contains, e.g., the additional term 223), the terms listed here are required to yield a composite also when prefixed with an ("additional") binary digit 1. - _M. F. Hasler_, Apr 05 2013 %H A065092 T. D. Noe, <a href="/A065092/b065092.txt">Table of n, a(n) for n=1..10000</a> %H A065092 William Paulsen, <a href="http://web.archive.org/web/www.csm.astate.edu/~wpaulsen/primemaze/mazeisol.html">Are some rooms totally isolated?</a> [Copy on web.archive.org, latest version as of Nov 04 2008] %H A065092 Carlos Rivera, <a href="http://primepuzzles.net/problems/prob_025.htm">Problem 25: William Paulsen's Prime Numbers Maze</a>, The Prime Puzzles & Problems Connection. %H A065092 Warren D. Smith et al., <a href="http://groups.yahoo.com/group/primenumbers/message/24989">Primes such that every bit matters?</a>, on "primenumbers" Yahoo group, Apr 04 2013. %H A065092 Warren D. Smith and others, <a href="/A065092/a065092.txt">Primes such that every bit matters?</a>, digest of 14 messages in primenumbers Yahoo group, Apr 3 - Apr 9, 2013. %H A065092 Terence Tao, <a href="http://arxiv.org/abs/0802.3361">A remark on primality testing and decimal expansions</a>, arXiv:0802.3361 [math.NT], 2008-2010; Journal of the Australian Mathematical Society 91:3 (2011), pp. 405-413. %e A065092 127 is in the sequence because 127d becomes 1111111b. "Changing a 1 to a 0 [from right to left] yields rooms 126, 125, 123, 119, 111, 95, or 62, all of which are composite. Furthermore, adding a digit 1 to the left of this number produces, 255 = 11111111b which is also composite. However, this room is not completely isolated from the maze because one can drop in from room 383d = 101111111b." Paulsen. %p A065092 q:= p-> isprime(p) and not ormap(i-> isprime(Bits[Xor](p, 2^i)), [$0..ilog2(p)+1]): %p A065092 select(q, [$2..5000])[]; # _Alois P. Heinz_, Jul 28 2025 %t A065092 Do[d = Prepend[ IntegerDigits[ Prime[n], 2], 0]; l = Length[d]; k = 1; While[k < l && !PrimeQ[ FromDigits[ If[d[[k]] == 1, ReplacePart[d, 0, k], ReplacePart[d, 1, k]], 2]], k++ ]; If[k == l, Print[ Prime[n]]], {n, 2, 500} ] %o A065092 (PARI) %o A065092 f(p)= %o A065092 { %o A065092 pow2=2; v=binary(p); L=#v-1; %o A065092 forstep(k=L,1,-1, %o A065092 if(v[k]==0, x=p+pow2, x=p-pow2); %o A065092 if(isprime(x), return(0)); %o A065092 pow2*=2 %o A065092 ); %o A065092 if(isprime(p+pow2), return(0)); return(1) %o A065092 }; %o A065092 forprime(p=5,3767, if(f(p), print1(p, ", "))) \\ _Washington Bomfim_, Jan 16 2011 %o A065092 (PARI) /* needs ver. >= 2.6 */ is_A065092(n)={!for(k=1,n,isprime(bitxor(n,k))&return;k+=k-1)&isprime(n)} \\ Note the strange behavior of the for() loop w.r.t. the upper limit. In PARI versions up to 2.4, the increment must take place at the beginning of the loop, viz "k>2 & k+=k-2" BEFORE isprime(), as to cover k=2^ceil(log[2](n)). - _M. F. Hasler_, Apr 05 2013 %o A065092 (Python) %o A065092 from sympy import isprime, primerange %o A065092 def ok(p): # p assumed prime %o A065092 return not any(isprime((1<<k)^p) for k in range(p.bit_length()+1)) %o A065092 def aupto(limit): %o A065092 alst = [] %o A065092 for p in primerange(2, limit+1): %o A065092 if ok(p): alst.append(p) %o A065092 return alst %o A065092 print(aupto(2917)) # _Michael S. Branicky_, Jul 26 2022 %Y A065092 Cf. A137985. %K A065092 base,nonn %O A065092 1,1 %A A065092 _Robert G. Wilson v_, Nov 10 2001 %E A065092 Links fixed & added by _M. F. Hasler_, Apr 05 2013