%I #33 Nov 23 2019 04:45:10
%S 7,113,265381,842468587426513207
%N Primes found among the denominators of the continued fraction rational approximations to Pi.
%C The next term is too large to include.
%H Joerg Arndt, <a href="/A086788/b086788.txt">Table of n, a(n) for n = 1..10</a>
%H Cino Hilliard, <a href="http://groups.msn.com/BC2LCC/continuedfractions.msnw">Continued fractions rational approximation of numeric constants</a>. [needs login]
%e The first 5 rational approximations to Pi are 3/1, 22/7, 333/106, 355/113, 103993/33102; of these, the prime denominators are 7 and 113.
%o (PARI)
%o cfracdenomprime(m,f) = { default(realprecision,3000); cf = vector(m+10); x=f; for(n=0,m, i=floor(x); x=1/(x-i); cf[n+1] = i; ); for(m1=0,m, r=cf[m1+1]; forstep(n=m1,1,-1, r = 1/r; r+=cf[n]; ); numer=numerator(r); denom=denominator(r); if(ispseudoprime(denom),print1(denom,",")); ) }
%o (PARI)
%o default(realprecision,10^5);
%o cf=contfrac(Pi);
%o n=0;
%o { for(k=1, #cf, \\ generate b-file
%o pq = contfracpnqn( vector(k,j, cf[j]) );
%o p = pq[1,1]; q = pq[2,1];
%o \\ if ( ispseudoprime(p), n+=1; print(n," ",p) ); \\ A086785
%o if ( ispseudoprime(q), n+=1; print(n," ",q) ); \\ A086788
%o ); }
%o /* _Joerg Arndt_, Apr 21 2013 */
%Y Cf. A086791, A086785.
%K easy,nonn
%O 1,1
%A _Cino Hilliard_, Aug 04 2003; corrected Jul 30 2004
%E Offset corrected by _Joerg Arndt_, Apr 21 2013
|