The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A049711 a(n) = n - prevprime(n). 24
 1, 1, 2, 1, 2, 1, 2, 3, 4, 1, 2, 1, 2, 3, 4, 1, 2, 1, 2, 3, 4, 1, 2, 3, 4, 5, 6, 1, 2, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 1, 2, 1, 2, 3, 4, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 1, 2, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6 (list; graph; refs; listen; history; text; internal format)
 OFFSET 3,3 COMMENTS All runs end in even numbers at a(p), new highs are found at A000101 and the increasing gap size is A005250. - Robert G. Wilson v, Dec 07 2001 All terms are positive since here the variant 2 (A151799(n) < n) of the prevprime function is used, rather than the variant 1 (A007917(n) <= n). - M. F. Hasler, Sep 09 2015 LINKS MAPLE with(numtheory); A049711 := n-> n-prevprime(n); MATHEMATICA PrevPrim[n_] := Block[ {k = n - 1}, While[ !PrimeQ[k], k-- ]; Return[k]]; Table[ n - PrevPrim[n], {n, 3, 100} ] Array[#-NextPrime[#, -1]&, 100, 3] (* Harvey P. Dale, Dec 07 2011 *) PROG (PARI) A049711(n)=n-precprime(n-1) \\ M. F. Hasler, Sep 09 2015 CROSSREFS Cf. A049613, A049653, A049716, A049847. Cf. A151799, A007917. Sequence in context: A305300 A330241 A175851 * A137293 A177803 A274080 Adjacent sequences:  A049708 A049709 A049710 * A049712 A049713 A049714 KEYWORD nonn AUTHOR STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified May 27 18:56 EDT 2020. Contains 334664 sequences. (Running on oeis4.)