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.

A381855 Starting from prime(n), a(n) is the minimum number > 1 of consecutive primes whose sum is the lesser of a twin prime pair.

Original entry on oeis.org

2, 95, 317, 23, 3, 5, 3, 3, 277, 7, 7, 25, 35, 237, 7, 5, 17, 41, 15, 33, 23, 7, 3, 111, 257, 3, 7, 57, 5, 11, 57, 13, 11, 79, 45, 67, 29, 97, 11, 15, 15, 21, 113, 19, 35, 15, 9, 5, 123, 29, 59, 27, 19, 227, 223, 37, 279, 53, 41, 3, 135, 53, 143, 81, 41, 29, 39, 63
Offset: 1

Views

Author

Abhiram R Devesh, Mar 08 2025

Keywords

Examples

			a(1) = 2 because we need to add the primes 2 and 3, to reach the lesser of the twin prime pair (5 and 7).
		

Crossrefs

Cf. A001359.

Programs

  • PARI
    a(n) = my(p=prime(n), q=nextprime(p+1), s = p+q, k=2); while (!(isprime(s) && isprime(s+2)), q=nextprime(q+1); s+=q; k++); k; \\ Michel Marcus, Mar 09 2025
  • Python
    import sympy
    def a(n):
       p=sympy.prime(n);s=p;c=1
       p=sympy.nextprime(p);s+=p;c+=1
       while not(sympy.isprime(s)and sympy.isprime(s+2)):p=sympy.nextprime(p);s+=p;c+=1
       return c