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.

Showing 1-2 of 2 results.

A233824 A recurrent sequence in Panaitopol's formula for pi(x), where pi(x) is the number of primes <= x.

Original entry on oeis.org

0, 1, 3, 13, 71, 461, 3447, 29093, 273343, 2829325, 31998903, 392743957, 5201061455, 73943424413, 1123596277863, 18176728317413, 311951144828863, 5661698774848621, 108355864447215063, 2181096921557783605
Offset: 0

Views

Author

Jonathan Sondow, Dec 17 2013

Keywords

Comments

Sum_{k=0..n} k!*a(n-k) = n*n!.
Panaitopol proved that x/pi(x) = log(x) - 1 - Sum_{k=1..m} a(k)/log(x)^k + O(1/log(x)^{m+1}) for m > 0.

Examples

			0!*a(0) = a(0) = 0*0!, so a(0) = 0.
0!*a(1) + 1!*a(0) = a(1) + a(0) = 1*1!, so a(1) = 1.
0!*a(2) + 1!*a(1) + 2!*a(0) = a(2) + a(1) + 2*a(0) = 2*2!, so a(2) = 4 - 1 = 3.
		

Crossrefs

Programs

  • Mathematica
    a[0] = 0; a[n_] := a[n] = n*n! - Sum[ k! a[n - k], {k, n - 1}]; Table[a@ n, {n, 0, 19}] (* Michael De Vlieger, Mar 26 2016 *)

Formula

a(n) = n*n! - Sum_{k=1..n-1} k!*a(n-k).
a(n) = A003319(n+1) if n > 0. (Proof. Set b(n) = A003319(n), so that b(n) = n! - Sum_{k=1..n-1} k!*b(n-k). To get b(n+1) = a(n) for n > 0, induct on n, use (n+1)! = n*n! + n!, and replace k with k+1 in the sum.)

A301277 Nearest integer to mean of first n primes.

Original entry on oeis.org

2, 3, 3, 4, 6, 7, 8, 10, 11, 13, 15, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 45, 47, 49, 51, 53, 55, 58, 60, 63, 65, 67, 70, 72, 75, 77, 80, 82, 85, 87, 90, 92, 94, 97, 100, 102, 105, 107, 110, 113, 115, 118, 121, 123, 126, 128, 131, 133
Offset: 1

Views

Author

N. J. A. Sloane, Mar 18 2018

Keywords

Comments

Differs from A075465 where ties are involved. - R. J. Mathar, Mar 20 2018

Examples

			The means are 2, 5/2, 10/3, 17/4, 28/5, 41/6, 58/7, 77/8, 100/9, 129/10, 160/11, 197/12, 238/13, 281/14, 328/15, 381/16, 440/17, 167/6, 568/19, 639/20, 712/21, 791/22, 38, 321/8, 212/5, ...
		

Crossrefs

Programs

  • Maple
    m := n -> add(ithprime(j),j=1..n)/n;
    m1:=[seq(m(n),n=1..100)];
    m2:=map(numer,m1); # A301273
    m3:=map(denom,m1); # A301274
    m4:=map(round,m1); # A301277
  • Mathematica
    Rest@ FoldList[{Append[First@ #1, #2], If[And[EvenQ@ #1, #2 == 1/2] & @@ {IntegerPart@ #, FractionalPart@ #}, Round@ # + 1, Round@ #] &@ Mean@ First@ #1} &, {{2}, 2}, Prime@ Range[2, 63]][[All, -1]] (* Michael De Vlieger, Apr 05 2018 *)
  • PARI
    a(n) = round(sum(i=1, n, prime(i))/n); \\ Altug Alkan, Mar 22 2018

Formula

a(n) = round(A007504(n) / n). - David A. Corneth, Mar 22 2018
a(n) ~ prime(n)/2 ~ n*log(n)/2. - Daniel Forgues, Mar 22 2018
Showing 1-2 of 2 results.