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”).

A053542
Distance from n-th composite number (A002808) to next prime.
1
1, 1, 3, 2, 1, 1, 3, 2, 1, 1, 3, 2, 1, 5, 4, 3, 2, 1, 1, 5, 4, 3, 2, 1, 3, 2, 1, 1, 3, 2, 1, 5, 4, 3, 2, 1, 5, 4, 3, 2, 1, 1, 5, 4, 3, 2, 1, 3, 2, 1, 1, 5, 4, 3, 2, 1, 3, 2, 1, 5, 4, 3, 2, 1, 7, 6, 5, 4, 3, 2, 1, 3, 2, 1, 1, 3, 2, 1, 1, 3, 2, 1, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 3, 2, 1, 5, 4, 3, 2, 1
OFFSET
1,3
FORMULA
Beginning with 2, make sequence of composites; measure distances to next prime
EXAMPLE
a(1)=4, composite; distance to next prime, 5, is 1.
MATHEMATICA
Table[NextPrime[n]-n, {n, Select[Range[150], CompositeQ]}] (* Harvey P. Dale, Apr 28 2016 *)
CROSSREFS
Cf. A002808.
Sequence in context: A010268 A181657 A172254 * A087284 A262311 A242950
KEYWORD
easy,nonn
AUTHOR
Enoch Haga, Jan 16 2000
EXTENSIONS
Edited by N. J. A. Sloane, Sep 09 2011
STATUS
approved