A386842 a(n) is the smallest prime number p in a sequence of n consecutive primes, such that the numbers formed by the last n digits of each prime in the sequence create another sequence of n consecutive prime numbers, all strictly less than p.
13, 131, 3079, 31307, 130211, 6006047, 65770459, 2174896369, 123463673149, 7326324078721
Offset: 1
Examples
a(2) = 131, because it is the smallest prime p such that there exists a sequence of 2 consecutive primes (131, 137), and the last 2 digits of each prime (31 and 37) are themselves consecutive prime numbers less than p. 1 [13] -> ending with 1 digit [3] (both consecutive primes) 2 [131, 137] -> ending with 2 digits [31, 37] (both consecutive primes) 3 [3079, 3083, 3089] -> ending with 3 digits [79, 83, 89] (both consecutive primes) 4 [31307, 31319, 31321, 31327] -> ending with 4 digits [1307, 1319, 1321, 1327] (both consecutive primes)
Links
- Carlos Rivera, Puzzle 1229. Set of consecutive primes such that..., The Prime Puzzles & Problems Connection.
Programs
-
PARI
a(n)={my(m=10^n,c=0,q,r); forprime(p=m, oo, if(!isprime(p%m), c=0, if(c&&nextprime(q%m+1)==p%m, c++, c=1;r=p); if(c==n, return(r)); q=p ))} \\ Andrew Howroyd, Aug 09 2025