OFFSET
1,5
COMMENTS
a(n) > 0 for n >= 5. For 5 <= n <= 24 can be shown by observation. For n > 24, Jitsuro Nagura proved that for some integer k, there is always a prime between k and (6/5)*k. Therefore 3*prime(n) - 2*prime(n+1) >= (3/5)*prime(n) > 0. - Ryan Bresler, Nov 17 2021
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
Jitsuro Nagura, On the interval containing at least one prime number, Proc. Japan Acad., 28 (1952), 177-181.
EXAMPLE
a(5)=7 because prime(5)=11, prime(6)=13 and 3*11 - 2*13 = 7.
MAPLE
a:=n->3*ithprime(n)-2*ithprime(n+1): seq(a(n), n=1..80); # Emeric Deutsch, May 28 2005
MATHEMATICA
3#[[1]]-2#[[2]]&/@Partition[Prime[Range[80]], 2, 1] (* Harvey P. Dale, Apr 17 2017 *)
PROG
(PARI) a(n) = my(p=prime(n)); 3*p - 2*nextprime(p+1); \\ Michel Marcus, Nov 17 2021
CROSSREFS
KEYWORD
sign
AUTHOR
Leroy Quet, May 27 2005
EXTENSIONS
More terms from Emeric Deutsch, May 28 2005
STATUS
approved