OFFSET
3,4
COMMENTS
LINKS
T. D. Noe, Table of n, a(n) for n = 3..10000
FORMULA
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
KEYWORD
easy,nonn
AUTHOR
Jonathan Vos Post, Aug 31 2006
EXTENSIONS
Extended by T. D. Noe, Oct 08 2012
STATUS
approved