login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A250623
a(n) = floor(n*log(prime(n))) + ceiling(n*log(n)) - 2*prime(n).
1
-4, -2, -2, -1, -2, 0, -1, 2, 2, -1, 2, -1, 0, 3, 4, 2, 0, 4, 1, 3, 8, 7, 8, 6, 1, 2, 8, 10, 16, 18, 3, 5, 4, 9, 2, 8, 7, 6, 8, 8, 7, 13, 5, 12, 15, 22, 10, -1, 2, 9, 13, 12, 19, 12, 12, 12, 11, 18, 18, 22, 29, 22, 8, 12, 19, 23, 8, 8, 2, 9, 13, 13, 11, 11, 11
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
FORMULA
a(n) = A250621(n) + A050502(n) - 2*A000040(n).
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
Sequence in context: A284398 A285001 A016511 * A123402 A205032 A368203
KEYWORD
sign,easy
AUTHOR
Freimut Marschner, Dec 02 2014
STATUS
approved