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!)
A046933 Number of composites between successive primes. 68
0, 1, 1, 3, 1, 3, 1, 3, 5, 1, 5, 3, 1, 3, 5, 5, 1, 5, 3, 1, 5, 3, 5, 7, 3, 1, 3, 1, 3, 13, 3, 5, 1, 9, 1, 5, 5, 3, 5, 5, 1, 9, 1, 3, 1, 11, 11, 3, 1, 3, 5, 1, 9, 5, 5, 5, 1, 5, 3, 1, 9, 13, 3, 1, 3, 13, 5, 9, 1, 3, 5, 7, 5, 5, 3, 5, 7, 3, 7, 9, 1, 9, 1, 5, 3, 5, 7, 3, 1, 3, 11, 7, 3, 7, 3, 5, 11, 1, 17 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,4
COMMENTS
a(n) is odd for n>1 since all primes except 2 are odd. - Joel Brennan, Jan 02 2023
LINKS
FORMULA
a(n) = prime(n+1) - prime(n) - 1 = A000040(n+1) - A000040(n) - 1.
a(n) = A001223(n) - 1.
a(n) = 2*A028334(n) - 1 for n>1. - Giovanni Teofilatto, Apr 19 2010
a(n) = Sum_{i=1..n-1} A036263(i). - Daniel Forgues, Apr 07 2014
EXAMPLE
a(1) = 0 since 2 is adjacent to 3;
a(2) = 1 since 4 is between 3 and 5;
a(4) = 3 = 11 - 7 - 1, etc.
MAPLE
A046933:=n->ithprime(n+1)-ithprime(n)-1; seq(A046933(n), n=1..100); # Wesley Ivan Hurt, Apr 15 2014
MATHEMATICA
Differences[Prime[Range[100]]] - 1 (* Arkadiusz Wesolowski, Nov 18 2011 *)
Table[Prime[n + 1] - Prime[n] - 1, {n, 100}] (* Wesley Ivan Hurt, Apr 15 2014 *)
Prepend[Drop[Length/@SequenceSplit[Range@Prime@100, {_?PrimeQ}], 1], 0] (* Federico Provvedi, Jul 19 2021 *)
PROG
(PARI) a(n)=prime(n+1)-prime(n)-1 \\ Charles R Greathouse IV, Nov 20 2012
(Haskell)
a046933 n = a046933_list !! (n-1)
a046933_list = map (subtract 1) a001223_list
-- Reinhard Zumkeller, Dec 12 2012
(Python)
from sympy import prime
def A046933(n): return prime(n+1)-prime(n)-1 # Chai Wah Wu, Jan 02 2024
CROSSREFS
Cf. A008996 (record values > 0).
Sequence in context: A066839 A372832 A176246 * A185091 A332031 A023511
KEYWORD
easy,nonn,nice
AUTHOR
Marc LeBrun, Dec 11 1999
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 August 20 22:43 EDT 2024. Contains 375340 sequences. (Running on oeis4.)