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
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, 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, 7, 1, 2, 2, 2, 1, 3, 2, 3, 2, 2, 4, 4, 6, 2, 6, 2, 3, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET
3,4
COMMENTS
See: A102415 Greatest semiprime less than n-th prime. See: A102414 Smallest semiprime greater than n-th prime.
LINKS
FORMULA
a(n) = Min{A000040(n)-s for s < A000040(n) and s in A001358(k)}. a(n) = A000040(n) - A102415(n).
MATHEMATICA
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 *)
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 *)
PROG
(PARI) dsemi(n)= { local(k=0); if(isprime(n), k=0; while(bigomega(n-k)<>2&&k<n, k=k+1)); return(k) }
{ forprime(n=5, 10^3, print(n, " ", dsemi(n))) } // Antonio Roldán, Oct 08 2012
CROSSREFS
Sequence in context: A226377 A140430 A123359 * A187760 A122143 A144868
KEYWORD
easy,nonn
AUTHOR
Jonathan Vos Post, Aug 31 2006
EXTENSIONS
Extended by T. D. Noe, Oct 08 2012
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 April 24 14:09 EDT 2024. Contains 371960 sequences. (Running on oeis4.)