cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A250623 a(n) = floor(n*log(prime(n))) + ceiling(n*log(n)) - 2*prime(n).

Original entry on oeis.org

-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

Views

Author

Freimut Marschner, Dec 02 2014

Keywords

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).

Examples

			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.
		

Programs

  • Mathematica
    a250623[n_] :=
    Floor[#*Log[Prime[#]]] + Ceiling[#*Log[#]] - 2*Prime[#] & /@ Range[n]; a250623[137] (* Michael De Vlieger, Dec 26 2014 *)
  • PARI
    vector(100,n,floor(n*log(prime(n)))+ceil(n*log(n))-2*prime(n)) \\ Derek Orr, Dec 30 2014

Formula

a(n) = A250621(n) + A050502(n) - 2*A000040(n).