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.

A327360 Minimal numerator among the fractions with n-digit numerator and n-digit denominator that best approximate Pi.

This page as a plain text file.
%I A327360 #62 Apr 23 2021 11:59:41
%S A327360 3,44,355,3195,99733,833719,5419351,80143857,657408909,6167950454,
%T A327360 42106686282,983339177173,8958937768937,94960529682104,
%U A327360 428224593349304,6134899525417045,66627445592888887,430010946591069243,5293386250278608690,31760317501671652140
%N A327360 Minimal numerator among the fractions with n-digit numerator and n-digit denominator that best approximate Pi.
%D A327360 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.)
%H A327360 Jon E. Schoenfield, <a href="/A327360/b327360.txt">Table of n, a(n) for n = 1..1000</a>
%H A327360 Jon E. Schoenfield, <a href="/A327360/a327360_1.txt">Magma program</a>
%H A327360 O. Zelenyak, <a href="https://books.google.com/books?id=JeUJAQAAQBAJ&amp;pg=PA255&amp;lpg=PA255&amp;dq=44+355+3195+99733&amp;source=bl&amp;ots=IFjYEQyUTl&amp;sig=ACfU3U3B-fXt58iDehAppCK6kuNTNnI8Xw&amp;hl=en&amp;sa=X&amp;ved=2ahUKEwjMlufQxbTkAhXlQ98KHddyAA0Q6AEwBXoECAkQAQ#v=onepage&amp;q=44%20355%203195%2099733&amp;f=false">Programming workshop on Turbo Pascal: Tasks, Algorithms and Solutions</a>, Litres, 2018, page 255.
%e A327360 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.
%t A327360 (* Given the 8th term, find the 9th term *)
%t A327360 (* This took twelve-plus hours to run on a laptop *)
%t A327360 ResultList = {};
%t A327360 nVal = 9;
%t A327360 tol = Abs[80143857/25510582 - Pi]; (* 80143857 is A327360(8), 25510582 is A327361(8) *)
%t A327360 Do[
%t A327360   CurrentNumerator = i;
%t A327360   Do[
%t A327360    CurrentDenominator = j;
%t A327360    CurrentQuotient = N[CurrentNumerator/CurrentDenominator];
%t A327360    If[
%t A327360     Abs[CurrentQuotient - Pi] <= tol,
%t A327360     ResultList = Append[ResultList, {CurrentNumerator, CurrentDenominator}]
%t A327360     ],
%t A327360    {j, Floor[i/(Pi + tol)], Floor[i/(Pi - tol)] + 1}],
%t A327360   {i, Floor[(Pi - tol)*10^(nVal - 1)], (10^nVal - 1)}];
%t A327360 DifferenceList =
%t A327360   Table[
%t A327360    Abs[ResultList[[i, 1]]/ResultList[[i, 2]] - Pi],
%t A327360    {i, 1, Length[ResultList]}];
%t A327360 Extract[ResultList, Position[DifferenceList, Min[DifferenceList]]]
%Y A327360 A327361 gives the corresponding denominators.
%Y A327360 Cf. A072398/A072399, which gives the best rational approximation to Pi subject to a different constraint.
%Y A327360 Cf. A002485/A002486, A063674/A063673, A325158/A325159.
%K A327360 base,frac,nonn
%O A327360 1,1
%A A327360 _Jason Zimba_, Sep 03 2019
%E A327360 Terms a(10) and beyond from _Jon E. Schoenfield_, Mar 11 2021