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!)
A121885 Excess of n-th prime over previous semiprime. 2

%I #12 Aug 12 2014 17:12:42

%S 1,1,1,3,2,4,1,3,5,2,2,4,1,2,1,3,2,2,4,2,1,2,2,6,8,1,3,2,4,2,3,5,3,5,

%T 2,2,1,4,1,3,4,6,3,5,2,2,1,3,7,2,4,2,3,1,2,4,3,3,5,2,2,2,4,3,2,2,1,3,

%U 7,1,2,2,2,1,3,2,3,2,2,4,4,6,2,6,2,3,3

%N Excess of n-th prime over previous semiprime.

%C See: A102415 Greatest semiprime less than n-th prime. See: A102414 Smallest semiprime greater than n-th prime.

%H T. D. Noe, <a href="/A121885/b121885.txt">Table of n, a(n) for n = 3..10000</a>

%F a(n) = Min{A000040(n)-s for s < A000040(n) and s in A001358(k)}. a(n) = A000040(n) - A102415(n).

%t SemiPrimeQ[n_Integer] := If[Abs[n] < 2, False, (2 == Plus @@ Transpose[FactorInteger[Abs[n]]][[2]])]; Table[i = Prime[n] - 1; While[! SemiPrimeQ[i], i--]; Prime[n] - i, {n, 3, 100}] (* _T. D. Noe_, Oct 08 2012 *)

%t eps[n_]:=Module[{c=n-1},While[PrimeOmega[c]!=2,c--];n-c]; Table[eps[n],{n,Prime[Range[3,90]]}] (* _Harvey P. Dale_, Aug 12 2014 *)

%o (PARI) dsemi(n)= { local(k=0); if(isprime(n),k=0;while(bigomega(n-k)<>2&&k<n, k=k+1)); return(k) }

%o { forprime(n=5,10^3,print(n," ",dsemi(n))) } // Antonio Roldán, Oct 08 2012

%Y Cf. A000040, A001358, A062721, A077068, A102414, A102415.

%K easy,nonn

%O 3,4

%A _Jonathan Vos Post_, Aug 31 2006

%E Extended by _T. D. Noe_, Oct 08 2012

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 April 25 03:15 EDT 2024. Contains 371964 sequences. (Running on oeis4.)