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.

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.

This page as a plain text file.
%I A345740 #52 Sep 14 2021 15:12:14
%S A345740 2,2,5,131,43,15619,281,6553,503,137771,3061,244140613,8179,22143361,
%T A345740 401393,199290359,491503,8392333984357,524269,3486784381,2097131,
%U A345740 226640986043,28311529,303745269775390601,113246183,9885033776809,469762021,176518460300597,805306339,77737724676061053405079339
%N 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.
%H A345740 David A. Corneth, <a href="/A345740/b345740.txt">Table of n, a(n) for n = 1..1049</a>
%F A345740 a(n) + n >= A053669(n)^n for n > 2 if a(n) exists. - _David A. Corneth_, Aug 14 2021
%e A345740 For n=1, a(1) = 2 as 2+1 = 3 (Omega(2 + 1) = Omega(3) = 1, see A000040(1)).
%e A345740 For n=2, 2+2 = 4 = 2*2 (semiprime, Omega(4) = 2, see A001358(1)).
%e A345740 For n=3, 5+3 = 8 = 2*2*2 (triprime, Omega(8) = 3, see A014612(1)).
%e A345740 For n=4, 131+4 = 135 = 3*3*3*5 (Omega(135) = 4,  see A014613(16)).
%t A345740 Table[k=1;While[PrimeOmega[Prime@k+n]!=n,k++];Prime@k,{n,11}] (* _Giorgos Kalogeropoulos_, Jun 25 2021 *)
%o A345740 (PARI) a(n) = my(p=2); while (bigomega(p+n) != n, p = nextprime(p+1)); p; \\ _Michel Marcus_, Jun 26 2021
%o A345740 (Python)
%o A345740 from sympy import factorint, nextprime, primerange
%o A345740 def Omega(n): return sum(e for f, e in factorint(n).items())
%o A345740 def a(n):
%o A345740     lb = 2**n
%o A345740     p = nextprime(max(lb-n, 1) - 1)
%o A345740     while Omega(p+n) != n: p = nextprime(p)
%o A345740     return p
%o A345740 print([a(n) for n in range(1, 12)]) # _Michael S. Branicky_, Aug 14 2021
%Y A345740 Cf. A000040, A001222, A001358, A014612, A014613, A053669, A069279, A097977.
%K A345740 nonn
%O A345740 1,1
%A A345740 _Zak Seidov_, Jun 25 2021