The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A179464 a(n) = min(nextprime(n),nextsemiprime(n)). 1
2, 3, 4, 5, 6, 7, 9, 9, 10, 11, 13, 13, 14, 15, 17, 17, 19, 19, 21, 21, 22, 23, 25, 25, 26, 29, 29, 29, 31, 31, 33, 33, 34, 35, 37, 37, 38, 39, 41, 41, 43, 43, 46, 46, 46, 47, 49, 49, 51, 51, 53, 53, 55, 55, 57, 57, 58, 59, 61, 61, 62, 65, 65, 65, 67, 67, 69, 69, 71, 71, 73, 73, 74, 77, 77, 77, 79, 79, 82, 82, 82, 83, 85, 85, 86, 87, 89, 89, 91, 91, 93, 93, 94 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
FORMULA
a(n) = min(A106325(n+1), A151800(n)). - Robert Israel, Oct 25 2017
EXAMPLE
n=1: nextprime(1)=2, nextsemiprime(1)=4, hence a(1)=2,
n=2: nextprime(2)=3, nextsemiprime(2)=4, hence a(2)=3,
n=3: nextprime(3)=5, nextsemiprime(3)=4, hence a(3)=4.
MAPLE
PS:= select(t -> numtheory:-bigomega(t)<=2, [$2..500]):
Res:= NULL:
k:= 1;
for n from 2 to max(PS) do
if n > PS[k] then k:= k+1 fi;
Res:= Res, PS[k];
od:
Res; # Robert Israel, Oct 25 2017
MATHEMATICA
Table[m=n+1; While[2!= Plus@@Last/@FactorInteger[m], m++]; Min[NextPrime[n], m], {n, 200}]
mnp[n_]:=Module[{s=n+1}, While[PrimeOmega[s]!=2, s++]; Min[NextPrime[n], s]]; Array[mnp, 100] (* Harvey P. Dale, Apr 23 2019 *)
PROG
(PARI) {for(n=1, 200, m=n+1; while(2<>bigomega(m), m++); print(min(nextprime(n+1), m)))}
CROSSREFS
Cf. A000040 The prime numbers, A001358 Semiprimes.
Sequence in context: A063932 A323785 A327626 * A071191 A300903 A097428
KEYWORD
nonn
AUTHOR
Zak Seidov, Jan 08 2011
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 6 09:31 EDT 2024. Contains 373119 sequences. (Running on oeis4.)