A367194 The y-coordinate of the point where x + y = n, x and y are integers and x/y is as close as possible to Pi.
1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18
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) = 1.
Programs
-
Maple
f:= proc(n) local x; x:= floor(n/(1+Pi)); if x = 0 then return 1 fi; if is((n-x)/x + (n-x-1)/(x+1) < 2*Pi) then x else x+1 fi end proc: map(f, [$1..100]); # Robert Israel, Nov 13 2023
Formula
a(n) is always either ceiling(n/(1+Pi)) or floor(n/(1+Pi)).
Comments