OFFSET
1,1
COMMENTS
It is known that n*log(n) < prime(n) < n*prime(n), n >= 4. The arithmetic mean of the limits of this inequality is f(n) = (floor((n*log(n)) + ceiling(n*prime(n))))/2. So a(n) is the difference between twice this quantity and 2*prime(n).
LINKS
Freimut Marschner, Table of n, a(n) for n = 1..10000
EXAMPLE
a(4) = floor(4*log(7)) + ceiling(4*log(4)) - 2*7 = floor(7.78...) + ceiling(5.54...) - 14 = 7 + 6 - 14 = -1;
a(6) = floor(6*log(13)) + ceiling(6*log(6)) - 2*13 = floor(15.38...) + ceiling(10.75..) - 26 = 15 + 11 - 26 = 0.
MATHEMATICA
a250623[n_] :=
Floor[#*Log[Prime[#]]] + Ceiling[#*Log[#]] - 2*Prime[#] & /@ Range[n]; a250623[137] (* Michael De Vlieger, Dec 26 2014 *)
PROG
(PARI) vector(100, n, floor(n*log(prime(n)))+ceil(n*log(n))-2*prime(n)) \\ Derek Orr, Dec 30 2014
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Freimut Marschner, Dec 02 2014
STATUS
approved