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.

A356741 a(n) is the least prime(m) such that prime(n) + prime(m)# is prime, where prime(m)# denotes the product of the first m primes, or -1 if no such prime(m) exists.

Original entry on oeis.org

2, 2, 3, 2, 3, 2, 7, 3, 2, 3, 3, 2, 5, 3, 3, 2, 3, 3, 2, 3, 5, 3, 11, 3, 2, 3, 2, 5, 11, 5, 3, 2, 7, 2, 3, 3, 5, 3, 3, 2, 5, 2, 3, 2, 5, 5, 3, 2, 7, 3, 2, 5, 3, 3, 3, 2, 3, 3, 2, 5, 7, 3, 2, 7, 5, 3, 5, 2, 5, 3, 5, 3, 3, 5, 3, 5, 7, 5, 5, 2, 7, 2, 3, 11, 3, 5, 3
Offset: 2

Views

Author

Alain Rocchelli, Sep 04 2022

Keywords

Comments

Conjecture: Such a prime(m) exists for every n, i.e., a(n) is never -1 for n>1.
Conjecture: Limit_{N->oo} (Sum_{n=2..N} a(n)) / (Sum_{n=2..N} log(prime(n))) = C with C constant between 0.5 and 1 inclusive.

Examples

			For n=4, prime(4)=7, and m=1 gives prime(m)=2 and prime(n) + prime(m)# = 7 + 2 = 9 (nonprime), but m=2 gives prime(m)=3 and prime(n) + prime(m)# = 7 + 2*3 = 13 (prime), so a(4) = prime(2) = 3.
		

Crossrefs

Programs

  • PARI
    a(n) = my(p=2, pr=2, pn=prime(n)); while (!isprime(pn+pr), p=nextprime(p+1); pr *= p); p; \\ Michel Marcus, Sep 05 2022
  • Python
    from sympy import isprime, nextprime, prime
    def a(n):
        pn, pm, pmsharp = prime(n), 2, 2
        while not isprime(pn + pmsharp): pm = nextprime(pm); pmsharp *= pm
        return pm
    print([a(n) for n in range(2, 89)]) # Michael S. Branicky, Sep 04 2022
    

Formula

a(n) = prime(A100380(n)). - Michel Marcus, Sep 12 2022