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.

A095117 a(n) = pi(n) + n, where pi(n) = A000720(n) is the number of primes <= n.

Original entry on oeis.org

0, 1, 3, 5, 6, 8, 9, 11, 12, 13, 14, 16, 17, 19, 20, 21, 22, 24, 25, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 39, 40, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 54, 55, 57, 58, 59, 60, 62, 63, 64, 65, 66, 67, 69, 70, 71, 72, 73, 74, 76, 77, 79, 80, 81, 82, 83, 84, 86, 87, 88, 89, 91
Offset: 0

Views

Author

Dean Hickerson, following a suggestion of Leroy Quet, May 28 2004

Keywords

Comments

Positions of first occurrences of n in A165634: A165634(a(n))=n for n>0. - Reinhard Zumkeller, Sep 23 2009
There exists at least one prime number p such that n < p <= a(n) for n >= 2. For example, 2 is in (2, 3], 5 in (3, 5], 5 in (4, 6], ..., and primes 73, 79, 83 and 89 are in (71, 91] (see Corollary 1 in the paper by Ya-Ping Lu attached in the links section). - Ya-Ping Lu, Feb 21 2021

Crossrefs

Complement of A095116.

Programs

  • Haskell
    a095117 n = a000720 n + toInteger n  -- Reinhard Zumkeller, Apr 17 2012
    
  • Maple
    with(numtheory): seq(n+pi(n),n=1..90); # Emeric Deutsch, May 02 2007
  • Mathematica
    Table[ PrimePi@n + n, {n, 0, 71}] (* Robert G. Wilson v, Apr 22 2007 *)
  • PARI
    a(n) = n + primepi(n); \\ Michel Marcus, Feb 21 2021
    
  • Python
    from sympy import primepi
    def a(n): return primepi(n) + n
    print([a(n) for n in range(72)]) # Michael S. Branicky, Feb 21 2021

Formula

a(0) = 0; for n>0, a(n) = a(n-1) + (if n is prime then 2, else 1). - Robert G. Wilson v, Apr 22 2007; corrected by David James Sycamore, Aug 16 2018

Extensions

Edited by N. J. A. Sloane, Jul 02 2008 at the suggestion of R. J. Mathar

A095116 a(n) = prime(n) + n - 1.

Original entry on oeis.org

2, 4, 7, 10, 15, 18, 23, 26, 31, 38, 41, 48, 53, 56, 61, 68, 75, 78, 85, 90, 93, 100, 105, 112, 121, 126, 129, 134, 137, 142, 157, 162, 169, 172, 183, 186, 193, 200, 205, 212, 219, 222, 233, 236, 241, 244, 257, 270, 275, 278, 283, 290, 293, 304, 311, 318, 325
Offset: 1

Views

Author

Dean Hickerson, following a suggestion of Leroy Quet, May 28 2004

Keywords

Comments

Positions of second occurrences of n in A165634: A165634(a(n)) = n. [Reinhard Zumkeller, Sep 23 2009]
a(n) = b(n)-th highest positive integer not equal to any a(k), 1 <= k <= n-1, where b(n) = primes = A000040(n). a(1) = 2, a(n) = a(n-1) + A000040(n) - A000040(n-1) + 1 for n >= 2. a(1) = 2, a(n) = a(n-1) + A001223(n-1) + 1 for n >= 2. a(n) = A014688(n) - 1. [Jaroslav Krizek, Oct 28 2009]
Comment from N. J. A. Sloane, Mar 28 2024 (Start):
On March 23 2024, Davide Rotondo sent me an email with the following conjecture. (I've simplified it a bit.)
For a positive integer n, define a sequence b by b(0) = n; b(i) = n - pi(b(i-1)) for i >= 1, where pi(x) = number of primes <= x.
The conjecture is that after some initial terms, b becomes periodic with period length 1 or 2, and the n for which the period is 2 are 3 together with the present sequence, that is, 2, 3, 4, 7, 10, 15, 18, 23, 26, 31, 38, 41, 48, ... (End)
Proof from Robert Israel, Mar 26 2024 (Start):
This is simply a consequence of the fact that if x < y, 0 <= pi(y) - pi(x) <= y - x and the inequality on the right is strict if y-x > 1 except for the case of 1 and 3.
Thus we start with b(0) - b(1) = pi(n). While |b(i) - b(i+1)| > 2 we get |b(i+1) - b(i+2)| = |pi(b(i+1)) - pi(b(i+2))| < |b(i) - b(i+1)|.
Eventually we must either reach |b(j+1) - b(j)| = 0 or |b(j+1) - b(j)| = 1.
If we reach 0, i.e. b(j+1) = b(j), then clearly b(k) = b(j) for all k > j.
If b(j+1) = b(j) + 1 = n - pi(b(j)), then b(j+2) = n - pi(b(j)+1) = b(j+1) or b(j+1)-1.
If b(j+1) = b(j) - 1, then b(j+2) = n - pi(b(j)-1) = b(j+1) or b(j+1)+1.
Thus from this point on we either get a 2-cycle or a 1-cycle. (End)

Crossrefs

Complement of A095117.
Essentially the same sequence as A014690.

Programs

Formula

a(n) = A014690(n-1), n > 1. [R. J. Mathar, Sep 05 2008]
Showing 1-2 of 2 results.