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.

A355161 Primes p such that p - prevprime(p) is not a power of 2.

Original entry on oeis.org

29, 37, 53, 59, 67, 79, 89, 127, 137, 149, 157, 163, 173, 179, 191, 211, 223, 239, 251, 257, 263, 269, 277, 293, 307, 331, 337, 347, 359, 373, 379, 389, 419, 431, 439, 449, 479, 509, 521, 541, 547, 557, 563, 569, 577, 587, 593, 599, 607, 613
Offset: 1

Views

Author

Reed Michael Upson, Jun 21 2022

Keywords

Comments

A130796(n) is prevprime(p).
A031925 and A031931 are subsequences, as 6 and 12 are not powers of 2.

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[2, 120]], (d = # - NextPrime[#, -1]) != 2^IntegerExponent[d, 2] &] (* Amiram Eldar, Jun 22 2022 *)
  • PARI
    isp2(n) = my(p); (n==1) || (isprimepower(n, &p) && (p==2)); \\ A000079
    isok(p) = isprime(p) && !isp2(p-precprime(p-1)) \\ Michel Marcus, Jun 22 2022
    
  • Python
    from itertools import islice, count
    from sympy import prime, prevprime
    def A355161_gen(): # generator of terms
        return filter(lambda n:((~(m:=n-prevprime(n))+1)&m)-m, (prime(n) for n in count(2)))
    A355161_list = list(islice(A355161_gen(),30)) # Chai Wah Wu, Aug 23 2022

Formula

a(n) = A151800(A130796(n)).