OFFSET
3,1
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
EXAMPLE
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).
PROG
(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
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Zak Seidov, Jun 10 2017
STATUS
approved