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.

User: Paul V. McKinney

Paul V. McKinney's wiki page.

Paul V. McKinney has authored 2 sequences.

A350591 Primes with Hamming distance of one from those in A320102.

Original entry on oeis.org

3, 7, 13, 19, 37, 43, 89, 101, 113, 139, 151, 157, 181, 197, 283, 311, 313, 347, 353, 383, 397, 409, 421, 433, 449, 479, 523, 563, 571, 593, 607, 619, 631, 643, 661, 673, 727, 751, 769, 811, 823, 829, 883, 911, 937, 967, 971, 983, 1009, 1013, 1021, 1049, 1097
Offset: 1

Author

Paul V. McKinney, Jan 07 2022

Keywords

Comments

The intersection of this sequence and A320102 is empty.
A320102| 1| 2| 4| 8| 16| 32| 64|128|256|
--------------------------------------------
2 | 3| * | | | | | | | |
5 | * | 7| * | 13| | 37| | | |
17 | * | 19| | | * | | | | |
41 | * | 43| | * | | * | | | |
73 | * | | | * | 89| | * | | |
97 | * | |101| |113| * | * | |353|
127 | * | * | * | * | * | * | * | |383|
137 | * |139| | * | | | | * | |
149 | * |151| * |157| * |181| | * | |
173 | * | | * | * | | * | | * | |
191 | * | * | * | * | * | * | | * | |
193 | * | |197| | | | * | * |449|
223 | * | * | * | * | * | | * | * |479|
233 | * | | | * | | * | * | * | |
239 | * | * | * | * | | * | * | * | |
251 | * | * | | * | * | * | * | * | |
257 | * | | | | | | | | * |
277 | * | | * | | * | | | | * |
281 | * |283| | * | * |313| |409| * |
307 | * | * |311| | * | * | | | * |
331 | * | * | | * |347| | * | | * |
337 | * | | | | * | | * | | * |
349 | * | | * | * | * | | * | | * |
373 | * | | * | | * | * | * | | * |
389 | * | | * |397| |421| | * | * |
401 | * | | |409| * |433| | * | * |
431 | * | * | * | * | | * | | * | * |
443 | * | * | | * | * | * | | * | * |
491 | * | * | | * | | * | * | * | * |
509 | * | | * | * | * | * | * | * | * |

Crossrefs

Cf. A320102.

Programs

  • Python
    from sympy import isprime, primerange
    def ok320102(p):
        onelocs = (i for i, bi in enumerate(bin(p)[2:][::-1]) if bi == '1')
        return not any(isprime(p-2**k) for k in onelocs)
    def aupto(limit):
        alst = []
        A350591 = set(p for p in primerange(1, limit+1) if ok320102(p))
        for p in primerange(1, limit+1):
            onelocs = (i for i, bi in enumerate(bin(p)[2:][::-1]) if bi == '1')
            if any(p-2**k in A350591 for k in onelocs):
                alst.append(p)
        return alst
    print(aupto(770)) # Michael S. Branicky, Jan 10 2022

Extensions

a(27) and beyond from Michael S. Branicky, Jan 10 2022

A320102 Primes where changing any single bit in the binary representation never results in a smaller prime.

Original entry on oeis.org

2, 5, 17, 41, 73, 97, 127, 137, 149, 173, 191, 193, 223, 233, 239, 251, 257, 277, 281, 307, 331, 337, 349, 373, 389, 401, 431, 443, 491, 509, 521, 547, 557, 569, 577, 599, 617, 641, 653, 683, 701, 719, 733, 757, 761, 787, 809, 821, 839, 853, 877, 881, 907, 919, 977, 997, 1019, 1033, 1087, 1093, 1153
Offset: 1

Author

Paul V. McKinney, Oct 06 2018

Keywords

Comments

Rooms in Paulsen's prime number maze that are not connected to any room with a lesser room number.
"The prime number maze is a maze of prime numbers where two primes are connected if and only if their base 2 representations differ in just one bit." - William Paulsen (A065123).
If k is prime and the bit 2^m in k is 0 then 2^m+k is not in the sequence.
If k is in the sequence then 2^m+k is not where the bit 2^m in k is 0. - David A. Corneth, Oct 09 2018

Examples

			7 is not in the sequence because there is a way to change only one single bit of its binary representation that results in a prime smaller than 7 {1(1)1,(1)11} {5,3}.
41 is in the sequence because changing any single bit of its binary representation binary representation never results in a smaller prime {10100(1),10(1)001,(1)01001} {40,25,9}.
		

Crossrefs

Programs

  • FORTRAN
    See "Links" for program.
    
  • Mathematica
    q[p_] := PrimeQ[p] && AllTrue[2^(-1 + Position[Reverse @ IntegerDigits[p, 2], 1] // Flatten), !PrimeQ[p - #] &]; Select[Range[1000], q] (* Amiram Eldar, Jan 13 2022 *)
  • PARI
    is(n) = if(!isprime(n), return(0)); b = binary(n); for(i=1, #b, if(b[i]==1, if(isprime(n-2^(#b-i)), return(0)))); 1 \\ David A. Corneth, Oct 09 2018
    
  • Python
    from sympy import isprime
    def ok(n):
        if not isprime(n): return False
        onelocs = (i for i, bi in enumerate(bin(n)[2:][::-1]) if bi == '1')
        return not any(isprime(n-2**k) for k in onelocs)
    print([k for k in range(1154) if ok(k)]) # Michael S. Branicky, Jan 10 2022