login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A096501 Difference between primes preceding n+1 and n. 3
0, 4, 1, 0, 2, 0, 2, 0, 0, 0, 4, 0, 2, 0, 0, 0, 4, 0, 2, 0, 0, 0, 4, 0, 0, 0, 0, 0, 6, 0, 2, 0, 0, 0, 0, 0, 6, 0, 0, 0, 4, 0, 2, 0, 0, 0, 4, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 2, 0, 0, 0, 0, 0, 6, 0, 0, 0, 4, 0, 2, 0, 0, 0, 0, 0, 6, 0, 0, 0, 4, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 4, 0, 2, 0, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

REFERENCES

Valus a(1) = 0 and a(2) = 4 are based on convention in Mathematica-language that PreviousPrime(1) = PreviousPrime(2) = -2. - Antti Karttunen, Jan 03 2019

LINKS

Antti Karttunen, Table of n, a(n) for n = 1..20000

Antti Karttunen, Data supplement: n, a(n) computed for n = 1..100000

FORMULA

For n > 2, a(n) = A010051(n) * A001223(A000720(n)-1) = A136548(1+n)-A136548(n). - Antti Karttunen, Jan 03 2019

MAPLE

0, 4, seq(prevprime(n+1)-prevprime(n), n=3..150); # Muniru A Asiru, Jan 03 2019

MATHEMATICA

<<NumberTheory`NumberTheoryFunctions` Table[PreviousPrime[n+1]-PreviousPrime[n], {n, 1, 256}]

Differences[NextPrime[Range[110], -1]] (* Harvey P. Dale, Jul 09 2017 *)

PROG

(PARI)

A136548(n) = if(n<3, 1, precprime(n-1));

A096501(n) = if(2==n, 4, A136548(1+n)-A136548(n)); \\ Antti Karttunen, Jan 03 2019

CROSSREFS

Cf. A000720, A001223, A010051, A096500, A136548, A151799, A175851.

Sequence in context: A281891 A124539 A249094 * A062862 A206799 A084119

Adjacent sequences:  A096498 A096499 A096500 * A096502 A096503 A096504

KEYWORD

nonn

AUTHOR

Labos Elemer, Jul 09 2004

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.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 22 16:34 EDT 2019. Contains 325224 sequences. (Running on oeis4.)