cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-3 of 3 results.

A086785 Primes found among the numerators of the continued fraction rational approximations to Pi.

Original entry on oeis.org

3, 103993, 833719, 4272943, 411557987, 7809723338470423412693394150101387872685594299
Offset: 1

Views

Author

Cino Hilliard, Aug 04 2003

Keywords

Comments

The numbers listed are primes. For m <= 10000 the only occurrence where both numerator and denominator are prime is 833719/265381.
The next term has 123 digits. - Harvey P. Dale, Dec 23 2018

Examples

			The first 4 rational approximations to Pi are 3/1, 22/7, 333/106, 355/113, 103993/33102 where 3 and 103993 are primes.
		

Crossrefs

Programs

  • Mathematica
    Select[Numerator[Convergents[Pi,100]],PrimeQ] (* Harvey P. Dale, Dec 23 2018 *)
  • PARI
    \\ Continued fraction rational approximation of numeric functions
    cfrac(m,f) = x=f; for(n=0,m,i=floor(x); x=1/(x-i); print1(i,","))
    cfracnumprime(m,f) = { cf = vector(100000); 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(isprime(numer),print1(numer,",")); ) }
    
  • PARI
    default(realprecision,10^5);
    cf=contfrac(Pi);
    n=0;
    { for(k=1, #cf,  \\ generate b-file
        pq = contfracpnqn( vector(k,j, cf[j]) );
        p = pq[1,1];  q = pq[2,1];
        if ( ispseudoprime(p), n+=1; print(n," ",p) );  \\ A086785
    \\    if ( ispseudoprime(q), n+=1; print(n," ",q) );  \\ A086788
    ); }
    /* Joerg Arndt, Apr 21 2013 */

Extensions

Corrected by Jens Kruse Andersen, Apr 20 2013
Corrected offset, Joerg Arndt, Apr 21 2013

A086791 Primes found among the numerators of the continued fraction rational approximations to e.

Original entry on oeis.org

2, 3, 11, 19, 193, 49171, 1084483, 563501581931, 332993721039856822081, 3883282200001578119609988529770479452142437123001916048102414513139044082579
Offset: 1

Views

Author

Cino Hilliard, Aug 04 2003; corrected Jul 24 2004

Keywords

Examples

			The first 8 rational approximations to e are 2/1, 3/1, 8/3, 11/4, 19/7, 87/32, 106/39, 193/71. The numerators 2, 3, 11, 19, 193 are primes.
		

Crossrefs

Programs

  • PARI
    \\ Continued fraction rational approximation of numeric constants f. m=steps.
    cfracnumprime(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(numer),print1(numer,",")); ) }
    
  • PARI
    default(realprecision,10^5);
    cf=contfrac(exp(1));
    n=0;
    { for(k=1, #cf,  \\ generate b-file
        pq = contfracpnqn( vector(k,j, cf[j]) );
        p = pq[1,1];  q = pq[2,1];
        if ( ispseudoprime(p), n+=1; print(n," ",p) );  \\ A086791
    \\    if ( ispseudoprime(q), n+=1; print(n," ",q) );  \\ A094008
    ); }
    /* Joerg Arndt, Apr 21 2013 */

A224936 Primes in either the numerator or denominator of continued fraction convergents to Pi.

Original entry on oeis.org

3, 7, 113, 103993, 833719, 265381, 4272943, 411557987, 842468587426513207, 7809723338470423412693394150101387872685594299
Offset: 1

Views

Author

Harvey P. Dale, Apr 20 2013

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Flatten[{Numerator[#],Denominator[#]}&/@Convergents[Pi,10000]],PrimeQ]
Showing 1-3 of 3 results.