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.

A288507 Least number k such that both prime(k+1) -/+ prime(k) are products of n prime factors (counting multiplicity).

Original entry on oeis.org

24, 319, 738, 57360, 1077529, 116552943
Offset: 3

Views

Author

Zak Seidov, Jun 10 2017

Keywords

Comments

Prime(k) + prime(k+1) cannot be semiprime, so the offset is 3.
For n=3 to 8, all terms k happen to satisfy prime(k+1) - prime(k) = 2^n. - Michel Marcus, Jul 24 2017

Examples

			n = 8: k = 116552943, p = prime(k) = 2394261637, q = prime(k+1) = 2394261893; both q-p = 2^8 and  p+q = 2*3^2*5*7^3*155119 are 8-almost primes (A046310).
		

Crossrefs

Programs

  • PARI
    a(n) = my(k = 1, p = 2, q = nextprime(p+1)); while((bigomega(p+q)!= n) || (bigomega(p-q)!= n), k++; p = q; q = nextprime(p+1)); k; \\ Michel Marcus, Jul 24 2017
    
  • Python
    from sympy import factorint, nextprime
    def A288507(n):
        k, p, q = 1, 2, 3
        while True:
            if sum(factorint(q-p).values()) == n and sum(factorint(q+p).values()) == n:
                return k
            k += 1
            p, q = q, nextprime(q) # Chai Wah Wu, Jul 23 2017