OFFSET
0,2
COMMENTS
We allow x=0 so that a(0)=1 is from round(100*0/1) = 0.
If some published statistic shows n percent, and that percentage was made by rounding to the nearest integer (and 0.5 rounds upwards), then it must have been from a sample of at least a(n) things.
EXAMPLE
For n=1, proportion 1/67 = 1.4992...% rounds to n=1 percent and 67 is the smallest denominator allowing that.
PROG
(PARI)
first(n) = {
res = vector(n, i, oo);
todo = 100;
for(i = 1, 100,
for(j = 1, i,
c = round(100*j/i);
if(0 < c && c <= n,
if(res[c] == oo,
todo--;
if(todo == 0,
break
));
res[c] = min(res[c], i))));
for(i = 101, n,
res[i] = res[i-100]);
concat(1, res)
} \\ David A. Corneth, Jun 23 2025
(Python)
from itertools import count
def A384670(n):
for y in count(1):
x, z = divmod(y*((n<<1)-1), 200)
if (200*(x+bool(z))+y)//(y<<1) == n:
return y # Chai Wah Wu, Jun 28 2025
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
James Beazley, Jun 06 2025
STATUS
approved
