login
A345740
a(n) is the least prime p such that Omega(p + n) = n where Omega is A001222, or 0 if no such prime exists.
1
2, 2, 5, 131, 43, 15619, 281, 6553, 503, 137771, 3061, 244140613, 8179, 22143361, 401393, 199290359, 491503, 8392333984357, 524269, 3486784381, 2097131, 226640986043, 28311529, 303745269775390601, 113246183, 9885033776809, 469762021, 176518460300597, 805306339, 77737724676061053405079339
OFFSET
1,1
LINKS
FORMULA
a(n) + n >= A053669(n)^n for n > 2 if a(n) exists. - David A. Corneth, Aug 14 2021
EXAMPLE
For n=1, a(1) = 2 as 2+1 = 3 (Omega(2 + 1) = Omega(3) = 1, see A000040(1)).
For n=2, 2+2 = 4 = 2*2 (semiprime, Omega(4) = 2, see A001358(1)).
For n=3, 5+3 = 8 = 2*2*2 (triprime, Omega(8) = 3, see A014612(1)).
For n=4, 131+4 = 135 = 3*3*3*5 (Omega(135) = 4, see A014613(16)).
MATHEMATICA
Table[k=1; While[PrimeOmega[Prime@k+n]!=n, k++]; Prime@k, {n, 11}] (* Giorgos Kalogeropoulos, Jun 25 2021 *)
PROG
(PARI) a(n) = my(p=2); while (bigomega(p+n) != n, p = nextprime(p+1)); p; \\ Michel Marcus, Jun 26 2021
(Python)
from sympy import factorint, nextprime, primerange
def Omega(n): return sum(e for f, e in factorint(n).items())
def a(n):
lb = 2**n
p = nextprime(max(lb-n, 1) - 1)
while Omega(p+n) != n: p = nextprime(p)
return p
print([a(n) for n in range(1, 12)]) # Michael S. Branicky, Aug 14 2021
KEYWORD
nonn
AUTHOR
Zak Seidov, Jun 25 2021
STATUS
approved