login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A114429 Larger of the greatest twin prime pair with n digits. 4

%I #28 Jan 18 2022 02:29:59

%S 7,73,883,9931,99991,999961,9999973,99999589,999999193,9999999703,

%T 99999999763,999999999961,9999999998491,99999999999973,

%U 999999999997969,9999999999999643,99999999999998809,999999999999998929

%N Larger of the greatest twin prime pair with n digits.

%C Also the denominator of the largest prime over prime fraction less than 10^n.

%H Abhiram R Devesh, <a href="/A114429/b114429.txt">Table of n, a(n) for n = 1..100</a>

%F a(n) = A092250(n) + 2. - _M. F. Hasler_, Jan 17 2022

%o (Python)

%o import sympy

%o for i in range(1,100):

%o p=sympy.prevprime(10**i)

%o while not sympy.isprime(p-2):

%o p=sympy.prevprime(p)

%o print(p)

%o # _Abhiram R Devesh_, Aug 02 2014

%o (PARI)

%o a(n)=my(p=precprime(10^n)); while(!ispseudoprime(p-2),p=precprime(p-1)); return(p)

%o vector(50, n, a(n)) \\ _Derek Orr_, Aug 02 2014

%o (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

%o (Python)

%o from sympy import prevprime

%o def a(n):

%o p = prevprime(10**n); pp = prevprime(p)

%o while p - pp != 2: p, pp = pp, prevprime(pp)

%o return p

%o print([a(n) for n in range(1, 19)]) # _Michael S. Branicky_, Jan 17 2022

%Y Cf. A092250 (a(n)-2: lesser of the pair).

%K base,easy,nonn

%O 1,1

%A _Cino Hilliard_, Feb 13 2006

%E Corrected by _T. D. Noe_, Nov 15 2006

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 16 11:48 EDT 2024. Contains 371711 sequences. (Running on oeis4.)