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-5 of 5 results.

A014688 a(n) = n-th prime + n.

Original entry on oeis.org

3, 5, 8, 11, 16, 19, 24, 27, 32, 39, 42, 49, 54, 57, 62, 69, 76, 79, 86, 91, 94, 101, 106, 113, 122, 127, 130, 135, 138, 143, 158, 163, 170, 173, 184, 187, 194, 201, 206, 213, 220, 223, 234, 237, 242, 245, 258, 271, 276, 279, 284, 291, 294, 305, 312, 319, 326
Offset: 1

Views

Author

Keywords

Comments

Conjecture: this sequence contains an infinite number of primes (A061068), yet contains arbitrarily long "prime deserts" such as the 11 composites in A014688 between a(6) = 19 and a(18) = 79 and the 17 composites in A014688 between a(48) = 271 and a(66) = 383. - Jonathan Vos Post, Nov 22 2004
Does an n exist such that n*prime(n)/(n+prime(n)) is an integer? - Ctibor O. Zizka, Mar 04 2008. The answer to Zizka's question is easily seen to be No: such an integer k would be positive and less than prime(n), but then k*(n + prime(n)) = prime(n)*n would be impossible. - Robert Israel, Apr 20 2015
Complement of A064427. - Jaroslav Krizek, Oct 28 2009
According to a theorem of Lu and Deng (see LINKS), there exists at least one prime number p such that a(n)-n < p <= a(n); equivalently pi(a(n)) - pi(a(n)-n) >= 1 (see A332086). For example, prime number 3 is in the range of (2,3], 5 in (3,5], 7 in (5,8], and 29 & 31 in (23,32]. - Ya-Ping Lu, Sep 02 2020

Crossrefs

Programs

Formula

a(n) = n + A000040(n) = n + A008578(n+1) = n + A158611(n+2). - Jaroslav Krizek, Aug 31 2009
a(n) = A090178(n+1) - 1 = (n+1)-th noncomposite number + n for n >= 2. a(n) = A167136(n+1). a(1) = 3, a(n) = a(n-1) + A008578(n+1) - A008578(n) + 1 for n >= 2. a(1) = 3, a(n) = a(n-1) + A001223(n-1) + 1 for n >= 3. - Jaroslav Krizek, Oct 28 2009
a(n) = 2*OR(p,n) - XOR(p,n), for n-th prime p. - Gary Detlefs, Oct 26 2013
a(n) = A078916(n) - n. - Zak Seidov, Nov 10 2013

Extensions

More terms from Vasiliy Danilov (danilovv(AT)usa.net), Jul 1998
Corrected for changes of offsets of A008578 and A158611 by Jaroslav Krizek, Oct 28 2009

A025003 a(1) = 2; a(n+1) = a(n)-th nonprime, where nonprimes begin at 1.

Original entry on oeis.org

2, 4, 8, 14, 22, 33, 48, 66, 90, 120, 156, 202, 256, 322, 400, 494, 604, 734, 888, 1067, 1272, 1512, 1790, 2107, 2472, 2890, 3364, 3903, 4515, 5207, 5990, 6875, 7868, 8984, 10238, 11637, 13207, 14959, 16909, 19075, 21483, 24173, 27149, 30436, 34080, 38103
Offset: 1

Views

Author

Keywords

Comments

Index of first occurrence of n in A090532.
Let b(n) (n >= 0) be the smallest integer k >= 1 that takes n steps to reach 1 iterating the map f: k -> k - pi(k). The sequence {b(n), n >= 0} begins 1, 2, 4, 8, 14, 22, 33, 48, 66, 90, 120, 156, ... and agrees with the present sequence except for b(0). - Ya-Ping Lu, Sep 07 2020

Examples

			From _Ya-Ping Lu_, Sep 07 2020: (Start)
a(1) = 2 because f(2) = 2 - pi(2) = 1 and m(2) = 1;
For the integer 3, since f(3) = 1. m(3) = 1, which is not bigger than m(1) or m(2). So, 3 is not a term in the sequence;
a(2) = 4 because f^2(4) = f(2) = 1 and m(4) = 2;
a(3) = 8 because f^3(8) = f^2(4) = 1 and m(8) = 3. (End)
		

Crossrefs

Programs

  • Maple
    N:= 50: # to get a(0)..a(N)
    V:= Array(0..N):
    V[0]:= 1: V[1]:= 2:
    m:= 2: p:= 3: g:= 1: n:= 1:
    do
      if g+p-m-1 >= V[n] then
        m:= V[n]+m-g;
        n:= n+1;
        V[n]:= m;
        if n = N then break fi;
        g:= V[n-1];
      else
        g:= g+p-m;
        m:= p+1;
        p:= nextprime(m);
      fi;
    od;
    convert(V, list); # Robert Israel, Sep 08 2020
  • Python
    from sympy import prime, primepi
    n_last = 0
    pi_last = 0
    ct_max = -1
    for n in range(1, 100001):
        ct = 0
        pi = pi_last + primepi(n) - primepi(n_last)
        n_c = n
        pi_c = pi
        while n_c > 1:
            nc -= pi_c
            ct += 1
            pi_c -= primepi(n_c + pi_c) - primepi(n_c)
        if ct > ct_max:
            print(n)
            ct_max = ct
        n_last = n
        pi_last = pi # Ya-Ping Lu, Sep 07 2020

Formula

a(n) = min(k: f^n(k) = 1), where f = A062298 and n-fold iteration of f is denoted by f^n. - Ya-Ping Lu, Sep 07 2020

A337334 a(n) = pi(b(n)), where pi is the prime counting function (A000720) and b(n) = a(n-1) + b(n-1) with a(0) = b(0) = 1.

Original entry on oeis.org

1, 1, 2, 3, 4, 5, 7, 9, 11, 14, 16, 21, 24, 30, 35, 42, 48, 58, 67, 78, 91, 103, 121, 138, 158, 181, 205, 233, 266, 298, 337, 378, 429, 480, 539, 602, 674, 751, 838, 930, 1031, 1147, 1274, 1402, 1556, 1715, 1896, 2090, 2296, 2527, 2777, 3047, 3340, 3669, 4016
Offset: 0

Views

Author

Ya-Ping Lu, Aug 23 2020

Keywords

Comments

It can be proved that this is an increasing sequence from the theorem of Lu and Deng (see LINKS), which states "the prime gap of a prime number is less than or equal to the prime count of the prime number”, or prime(n+1) - prime(n) <= pi(prime(n)).

Examples

			a(1) = pi(b(1)) = pi(a(0) + b(0)) = pi(1 + 1) = pi(2) = 1
a(2) = pi(b(2)) = pi(a(1) + b(1)) = pi(1 + 2) = pi(3) = 2
a(3) = pi(b(3)) = pi(a(2) + b(2)) = pi(2 + 3) = pi(5) = 3
a(4) = pi(b(4)) = pi(a(3) + b(3)) = pi(3 + 5) = pi(8) = 4
a(54)= pi(b(54))= pi(a(53)+ b(53))= pi(3669+34327)=pi(37996)=4016
		

Crossrefs

Cf. A000720 (pi), A014688 (prime(n)+n), A332086.

Programs

  • Maple
    A337334 := proc(n)
        option remember;
        if n = 0 then
            1;
        else
            numtheory[pi](A061535(n)) ;
        end if;
    end proc:
    seq(A337334(n),n=0..20) ; # R. J. Mathar, Jun 18 2021
  • Python
    from sympy import primepi
    a_last = 1
    b_last = 1
    for n in range(1, 1001):
        b = a_last + b_last
        a = primepi(b)
        print(a)
        a_last = a
        b_last = b

Formula

a(n) = pi(b(n)), where b(n) = a(n-1) + b(n-1) with a(0) = b(0) = 1.
a(n) = A000720(A061535(n)), n>=1. - R. J. Mathar, Jun 18 2021

Extensions

a(0) inserted by R. J. Mathar, Jun 18 2021

A334614 a(n) = pi(prime(n) - n) + n, where pi is the prime counting function.

Original entry on oeis.org

1, 2, 4, 6, 8, 10, 11, 13, 15, 18, 19, 21, 22, 24, 26, 28, 30, 32, 34, 35, 36, 38, 40, 42, 45, 47, 48, 50, 51, 53, 55, 57, 60, 61, 65, 66, 67, 68, 70, 72, 74, 76, 77, 79, 81, 82, 85, 88, 89, 91, 93, 94, 95, 99, 101, 102, 104, 105, 106, 107, 108, 112, 116, 117
Offset: 1

Views

Author

Ya-Ping Lu, Sep 08 2020

Keywords

Comments

It can be shown that a(n) > a(n-1) >= 1 and a(n) <= 2*n - 1 < 2*n (see proofs in the Links section).

Crossrefs

Programs

  • Mathematica
    Table[PrimePi[Prime[n] - n] + n, {n, 1, 64}] (* Amiram Eldar, Sep 09 2020 *)
  • PARI
    a(n) = n + primepi(prime(n) - n); \\ Michel Marcus, Sep 09 2020
  • Python
    from sympy import prime, primepi
    for n in range(1, 100001):
        a_n = primepi(prime(n) - n) + n
        print(a_n)
    

Formula

a(n) = A000720(A014689(n)) + n.
a(n) = A065328(n) + n. - Michel Marcus, Sep 12 2020

A344117 Number of twin prime pairs in the range (6*n + 1, 6*(n + m) + 1], where m is the number of twin prime pairs, 6*k +- 1 for k = 1, 2, ..., n.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 3, 3, 2, 2, 2, 3, 3, 4, 4, 3, 3, 4, 4, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 4, 4, 4, 3, 3, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5
Offset: 1

Views

Author

Ya-Ping Lu, Jun 24 2021

Keywords

Comments

Conjecture: a(n) >= 1.

Crossrefs

Programs

  • Python
    from sympy import isprime
    def istwin(m): return 1 if isprime(6*m-1)*isprime(6*m+1) == 1 else 0
    ct1 = 0
    for n in range(1, 100):
        ct1 += istwin(n); ct = 0
        for m in range (n + 1, n + ct1 + 1): ct += istwin(m)
        print(ct)
Showing 1-5 of 5 results.