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.

A334051 The difference between the number of prime numbers in the ranges (1, p_n] and (p_n, 2*p_n], where p_n is the n-th prime.

This page as a plain text file.
%I A334051 #19 Oct 09 2020 09:03:41
%S A334051 0,1,2,2,2,3,3,4,4,4,4,3,4,5,6,5,4,6,6,6,8,7,8,8,6,6,8,9,11,12,8,9,8,
%T A334051 9,8,10,9,10,11,12,11,12,11,12,13,14,12,10,11,12,12,13,14,13,13,13,15,
%U A334051 16,17,18,19,18,14,14,16,17,13,14,13,15,16,17,16,16
%N A334051 The difference between the number of prime numbers in the ranges (1, p_n] and (p_n, 2*p_n], where p_n is the n-th prime.
%F A334051 a(n) = 2*n - pi(2*p_n).
%F A334051 a(n) = 2*n - A020900(n). - _Michel Marcus_, Sep 11 2020
%F A334051 a(n) = 1 + A331677(n). - _Alois P. Heinz_, Oct 09 2020
%e A334051 a(6) = 2*6 - pi(2*p_6) = 12 - pi(2*13) = 12 - pi(26) = 12 - 9 = 3.
%o A334051 (Python)
%o A334051 from sympy import prime, primepi
%o A334051 for n in range(1, 10001):
%o A334051     a = 2*n - primepi(2*prime(n))
%o A334051     print(a)
%o A334051 (PARI) a(n) = 2*n - primepi(2*prime(n)); \\ _Michel Marcus_, Sep 11 2020
%Y A334051 Cf. A000040, A000720, A020900, A331677.
%K A334051 nonn
%O A334051 1,3
%A A334051 _Ya-Ping Lu_, Sep 11 2020