OFFSET
0,1
COMMENTS
When the fractional part is 0.5, rounding in either direction is allowed.
FORMULA
Find the smallest N such that there is some x > 0 with abs(100*x/N - n) <= 0.5.
EXAMPLE
a(31)=13 because 4/13 = 0.31 (to two digits after the decimal point).
MATHEMATICA
Table[LinearProgramming[{1, 0}, {{-n/100 + 0.005, 1}, {n/100 + 0.005, -1}}, {0, 0}, {1, 1}, Integers], {n, 0, 100}] // Transpose // First
CROSSREFS
KEYWORD
nonn,base,easy,fini,full
AUTHOR
Patrick D McLean, Mar 21 2014
EXTENSIONS
Edited by Jonathan Dushoff, Apr 22 2022
STATUS
approved