OFFSET
1,1
COMMENTS
Also the denominator of the largest prime over prime fraction less than 10^n.
LINKS
Abhiram R Devesh, Table of n, a(n) for n = 1..100
FORMULA
a(n) = A092250(n) + 2. - M. F. Hasler, Jan 17 2022
MATHEMATICA
Table[i=1; Until[PrimeQ[10^n-i]&&PrimeQ[10^n-i-2], i++]; 10^n-i, {n, 18}] (* James C. McMahon, Jul 31 2024 *)
PROG
(Python)
import sympy
for i in range(1, 100):
p=sympy.prevprime(10**i)
while not sympy.isprime(p-2):
p=sympy.prevprime(p)
print(p)
# Abhiram R Devesh, Aug 02 2014
(PARI)
a(n)=my(p=precprime(10^n)); while(!ispseudoprime(p-2), p=precprime(p-1)); return(p)
vector(50, n, a(n)) \\ Derek Orr, Aug 02 2014
(PARI) apply( {A114429(n, p=10^n)=until(2==p-p=precprime(p-1), ); p+2}, [1..22]) \\ twice as fast by avoiding additional ispseudoprime(). - M. F. Hasler, Jan 17 2022
(Python)
from sympy import prevprime
def a(n):
p = prevprime(10**n); pp = prevprime(p)
while p - pp != 2: p, pp = pp, prevprime(pp)
return p
print([a(n) for n in range(1, 19)]) # Michael S. Branicky, Jan 17 2022
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Cino Hilliard, Feb 13 2006
EXTENSIONS
Corrected by T. D. Noe, Nov 15 2006
STATUS
approved