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.
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
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).
Links
- Abhiram R Devesh, Table of n, a(n) for n = 1..10000
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