login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A065870
n-th prime - n-th semiprime.
2
-2, -3, -4, -3, -3, -2, -4, -3, -2, 3, -2, 3, 6, 5, 8, 7, 10, 10, 12, 14, 15, 17, 18, 20, 23, 24, 21, 22, 23, 26, 36, 38, 43, 44, 43, 40, 42, 45, 48, 52, 57, 58, 62, 60, 63, 58, 69, 80, 82, 83, 78, 81, 82, 90, 91, 94, 92, 93, 94, 96, 96, 99, 106, 109, 110, 112, 125, 128, 134, 135, 138, 142, 149, 154, 158, 157, 154, 160, 154, 160
OFFSET
1,1
LINKS
FORMULA
a(n) = A000040(n) - A001358(n). - Zak Seidov, Apr 29 2015
EXAMPLE
Prime_1 - semiprime_1 = 2 - 4 = -2, prime_2 - semiprime_2 = 3 - 6 = -3, prime_3 - semiprime_3 = 5 - 9 = -4, etc.
MATHEMATICA
nn=250; Module[{pr=Prime[Range[nn]], sp=Select[Range[nn], PrimeOmega[ #]==2&], len}, len=Min[nn, Length[sp]]; #[[1]]-#[[2]]&/@ Thread[ {Take[ pr, len], Take[sp, len]}]](* Harvey P. Dale, Aug 14 2013 *)
PROG
(PARI) m=0; for (n=4, 250, if (bigomega(n) == 2, m = m + 1; print1(prime(m) - n, ", ")))
(PARI) n=m=0; for (k=1, 10^9, if (bigomega(k) != 2, next); m = m + 1; write("b065870.txt", n++, " ", prime(m) - k); if (n==1000, return) ) \\ Harry J. Smith, Nov 02 2009
CROSSREFS
Cf. A000040, A001358, A038529 (n-th prime - n-th composite).
Sequence in context: A306461 A101497 A274007 * A377887 A123699 A322808
KEYWORD
easy,sign
AUTHOR
Robert A. Stump (bee_ess107(AT)yahoo.com), Dec 07 2001
EXTENSIONS
More terms from Rick L. Shepherd, Mar 09 2002
STATUS
approved