login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A327361 Minimal denominator among the fractions with n-digit numerator and n-digit denominator that best approximate Pi. 2
1, 14, 113, 1017, 31746, 265381, 1725033, 25510582, 209259755, 1963319607, 13402974518, 313006581566, 2851718461558, 30226875395063, 136308121570117, 1952799169684491, 21208174623389167, 136876735467187340, 1684937174853026414, 10109623049118158484 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

REFERENCES

O. Zelenyak, Programming workshop on Turbo Pascal: Tasks, Algorithms and Solutions, Litres, 2018, page 255. (Provides first 8 terms. Also contains similar sequences for sqrt(2) and e.)

LINKS

Jon E. Schoenfield, Table of n, a(n) for n = 1..1000

O. Zelenyak, Programming workshop on Turbo Pascal: Tasks, Algorithms and Solutions, Litres, 2018, page 255.

EXAMPLE

The fractions with 2-digit numerators and 2-digit denominators that best approximate Pi are 44/14 and 88/28. The fraction with 6-digit numerator and 6-digit denominator that best approximates Pi is 833719/265381.

MATHEMATICA

(* Given the 8th term, find the 9th term *)

(* This took twelve-plus hours to run on a laptop *)

ResultList = {};

nVal = 9;

tol = Abs[80143857/25510582 - Pi]; (* 80143857 is A327360(8), 25510582 is A327361(8) *)

Do[

  CurrentNumerator = i;

  Do[

   CurrentDenominator = j;

   CurrentQuotient = N[CurrentNumerator/CurrentDenominator];

   If[

    Abs[CurrentQuotient - Pi] <= tol,

    ResultList = Append[ResultList, {CurrentNumerator, CurrentDenominator}]

    ],

   {j, Floor[i/(Pi + tol)], Floor[i/(Pi - tol)] + 1}],

  {i, Floor[(Pi - tol)*10^(nVal - 1)], (10^nVal - 1)}];

DifferenceList =

  Table[

   Abs[ResultList[[i, 1]]/ResultList[[i, 2]] - Pi],

   {i, 1, Length[ResultList]}];

Extract[ResultList, Position[DifferenceList, Min[DifferenceList]]]

CROSSREFS

A327360 gives the corresponding numerators.

Cf. A072398/A072399, which gives the best rational approximation to Pi subject to a different constraint.

Cf. A002485/A002486, A063674/A063673, A325158/A325159.

Sequence in context: A155655 A007817 A285147 * A293874 A044346 A044727

Adjacent sequences:  A327358 A327359 A327360 * A327362 A327363 A327364

KEYWORD

base,frac,nonn,more

AUTHOR

Jason Zimba, Sep 03 2019

EXTENSIONS

a(10)-a(20) from Jon E. Schoenfield, Mar 12 2021

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 28 10:01 EDT 2021. Contains 348327 sequences. (Running on oeis4.)