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.

A265109 a(n) = largest k such that prime(n) + A002110(k) is prime.

Original entry on oeis.org

0, 1, 2, 3, 3, 4, 6, 7, 8, 6, 5, 9, 8, 8, 14, 9, 16, 17, 14, 14, 16, 21, 11, 19, 14, 24, 25, 15, 18, 11, 28, 12, 8, 19, 16, 22, 35, 31, 36, 25, 31, 16, 40, 30, 23, 41, 39, 35, 10, 32, 43, 38, 24, 41, 19, 35, 23, 55, 54, 24, 53, 50, 57, 62, 48, 36, 64, 21, 45, 54
Offset: 1

Views

Author

Altug Alkan, Dec 01 2015

Keywords

Comments

a(n) = n-1 iff a(n) is in A035346 for n > 1.

Examples

			a(4) = 3 because A002110(3) + prime(4) = A002110(3) + 7 = 37 is prime.
		

Crossrefs

Programs

  • PARI
    a(n) = {my(k=1); while(k, if(ispseudoprime(prod(i=1, n-k, prime(i)) + prime(n)), return(n-k)); k++)}
    
  • Python
    from itertools import count
    from sympy import isprime, prime, primorial
    def A002110(n): return primorial(n) if n > 0 else 1
    def A265109(n):
        pn = prime(n)
        return next(k for k in range(n-1, -1, -1) if isprime(pn+A002110(k)))
    print([A265109(n) for n in range(1, 31)]) # Michael S. Branicky, Jan 10 2025

Formula

a(n) < n.