OFFSET
1,1
EXAMPLE
3 + 1/7 is closest to Pi in absolute value among numbers of the form 3 + 1/k (k an integer); 3.1 + 1/24 is closest to Pi in absolute value among numbers of the form 3.1 + 1/k (k an integer); 3.14 + 1/628 is closest to Pi in absolute value among numbers of the form 3.14 + 1/k (k an integer).
MATHEMATICA
Table[
truncpi = Floor[10^(n - 1)*Pi]/10^(n - 1);
SortBy[
{Floor[1/(Pi - truncpi)], Ceiling[1/(Pi - truncpi)]},
N[Abs[Pi - (truncpi + 1/#)]] &
][[1]],
{n, 1, 20}] (* first 20 terms *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Jason Zimba, May 13 2017
STATUS
approved