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.

A377838 Let p = prime(n), then a(n) is the least prime q < p such that p * q# + 1 is prime.

Original entry on oeis.org

2, 2, 3, 2, 3, 3, 5, 2, 2, 13, 3, 2, 5, 3, 2, 7, 3, 5, 5, 3, 5, 2, 2, 11, 3, 3, 3, 5, 2, 13, 2, 3, 7, 13, 3, 7, 7, 5, 2, 2, 3, 2, 5, 13, 11, 29, 5, 19, 5, 2, 2, 3, 2, 3, 3, 13, 3, 3, 2, 3, 2, 13, 3, 3, 5, 3, 5, 3, 7, 7, 2, 3, 3, 11, 5, 67, 3, 7, 17, 2, 7, 2, 7
Offset: 2

Views

Author

Jeppe Stig Nielsen, Nov 09 2024

Keywords

Comments

The notation q# means A034386(q).
Buhler, Crandall and Penk conjecture a(n) exists for all n > 1.

Examples

			For a(122), consider 673, the 122nd prime. Search for primes of form 673*2*3*5*7*...*q + 1. The first such prime appears at q=509 (and 509 is less than 673). Therefore a(122) = 509.
		

Crossrefs

Cf. A034386.

Programs

  • PARI
    a(n)=p=prime(n);m=p;forprime(q=2,p-1,m*=q;ispseudoprime(m+1)&&return(q));error("none")