A367193 The x-coordinate of the point where x + y = n, x and y are integers and x/y is as close as possible to Pi.
0, 1, 2, 3, 4, 4, 5, 6, 7, 7, 8, 9, 10, 11, 11, 12, 13, 14, 14, 15, 16, 17, 17, 18, 19, 20, 20, 21, 22, 23, 23, 24, 25, 26, 27, 27, 28, 29, 30, 30, 31, 32, 33, 33, 34, 35, 36, 36, 37, 38, 39, 39, 40, 41, 42, 42, 43, 44, 45, 45, 46, 47, 48, 49, 49, 50, 51, 52
Offset: 1
Examples
For n = 3, the possible fractions are (0,3), (1,2), (2,1) as any negative values would would be further from Pi than 0/3. The closest fraction to Pi out of these is 2/1 so a(3) = 2.
Formula
a(n) is either ceiling(n*Pi/(1+Pi)) or floor(n*Pi/(1+Pi)).
a(n) = round((2*n*Pi + n - sqrt(Pi^2 + 2*Pi + n^2 + 1))/(2*Pi + 2)). - Jon E. Schoenfield, Nov 17 2023
Extensions
Corrected information and made it in line with A367194.
Comments