OFFSET
1,3
COMMENTS
The theorem that a(n) > 0 for all n is known as "Bertrand's Postulate", and was proved by Tchebycheff in 1852.
The analog for Ramanujan primes is Paksoy's theorem that 2*R(n) - R(n+1) > 0 for n > 1. See A233822. - Jonathan Sondow, Dec 16 2013
REFERENCES
J. V. Uspensky and M. A. Heaslet, Elementary Number Theory, McGraw-Hill, NY, 1939.
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..10001 (first 1000 terms from Harry J. Smith)
FORMULA
MAPLE
a:= n-> (p-> 2*p(n)-p(n+1))(ithprime):
seq(a(n), n=1..60); # Alois P. Heinz, Feb 09 2022
MATHEMATICA
Table[2*Prime[n]-Prime[n+1], {n, 60}] (* James C. McMahon, Apr 27 2024 *)
2#[[1]]-#[[2]]&/@Partition[Prime[Range[70]], 2, 1] (* Harvey P. Dale, Jul 29 2024 *)
ListConvolve[{-1, 2}, Prime[Range[100]]] (* Paolo Xausa, Nov 02 2024 *)
PROG
(PARI) a(n) = 2*prime(n) - prime(n + 1); \\ Harry J. Smith, Aug 03 2009
(Haskell)
a062234 n = a062234_list !! (n-1)
a062234_list = zipWith (-) (map (* 2) a000040_list) (tail a000040_list)
-- Reinhard Zumkeller, May 31 2015
CROSSREFS
KEYWORD
easy,nonn,changed
AUTHOR
Reinhard Zumkeller, Jun 29 2001
EXTENSIONS
Edited by N. J. A. Sloane, Feb 24 2023
STATUS
approved