A327360 Minimal numerator among the fractions with n-digit numerator and n-digit denominator that best approximate Pi.
3, 44, 355, 3195, 99733, 833719, 5419351, 80143857, 657408909, 6167950454, 42106686282, 983339177173, 8958937768937, 94960529682104, 428224593349304, 6134899525417045, 66627445592888887, 430010946591069243, 5293386250278608690, 31760317501671652140
Offset: 1
Examples
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.
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
- Jon E. Schoenfield, Magma program
- O. Zelenyak, Programming workshop on Turbo Pascal: Tasks, Algorithms and Solutions, Litres, 2018, page 255.
Crossrefs
Programs
-
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]]]
Extensions
Terms a(10) and beyond from Jon E. Schoenfield, Mar 11 2021