[Question]
  [
Sometimes I see a claim like "80% of respondents agreed" and I think "what was your sample size? 5?" because, of course, with a sample size of 5 it's possible to get 80% to agree on something. If the claim is "47% of respondents agreed" then I know it must be a larger sample size.[1]
## challenge
Given a positive integer x‚â§100, output the minimum number of respondents needed for an honest claim that "x% of respondents agreed".
Input and output will be however integers (or numbers) are normally handled.
This is code golf.
Caveat: Note the effect of [rounding](//en.wikipedia.org/wiki/Rounding#Rounding_to_the_nearest_integer). For example, a claim of "12% of respondents agreed" can mean that there were 8 respondents, 1 agreed, and the claim is rounding half down. Likewise, "13% of respondents agreed" can mean there were 8 respondents, 1 agreed, and the claim is rounding half up. Assume numbers *closest* to an integer are rounded to that integer, but you must account for both of ways of rounding *half*. Thus, on an input of 12 *or* of 13, your algorithm should output 8.
## examples
* 1 ‚Ü¶ 67
* 2 ‚Ü¶ 40
* 100 ‚Ü¶ 1
---
[1] Of course, this is assuming that what I'm reading is telling the truth.
  
[Answer]
# [K (ngn/k)](https://codeberg.org/ngn/k), 27 bytes
```
**&~`i$(199*%/:/&=69)-1.99*
```
[Try it online!](https://ngn.codeberg.page/k#eJxLs9LSUqtLyFTRMLS01FLVt9JXszWz1NQ11ANyubjS1A21FQ0NDACu6ggK)
Based on the formula from the [OEIS entry](https://oeis.org/A239525):
> 
> Find the smallest N such that there is some x > 0 with abs(100\*x/N - n) <= 0.5.
> 
> 
> 
For golfing reasons this actually checks -1 < 1.99\*(100\*x/N - n) < 1, which happens to be equivalent on the domain of the problem.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~¬†14¬†~~ 12 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
-2 thanks to Nick Kennedy! (Make a 100 by 100 table with values over 100% rather than a triangle of values.)
```
·∫°»∑2√∑√æ√ó¬§·∏§·ªä¬ßT·∏¢
```
A monadic Link that accepts a positive integer from \$[1,100]\$, the reported percentage, and yields another positive integer, the minimal number of respondents.
**[Try it online!](https://tio.run/##ASUA2v9qZWxsef//4bqhyLcyw7fDvsOXwqThuKThu4rCp1ThuKL///80 "Jelly ‚Äì Try It Online")** Or see [all 100](https://tio.run/##y0rNyan8///hroUnthsd3n543@Hph5Y83LHk4e6uQ8tDHu5Y9B8k3v6oac1/AA "Jelly ‚Äì Try It Online").
### How?
```
·∫°»∑2√∑√æ√ó¬§·∏§·ªä¬ßT·∏¢ - Link: positive intger from [1..100], P
      ¬§      - nilad followed by link(s) as a nilad:
 »∑2          -   10^2 -> 100
    √æ        -   {[1..100]} x {[1..100]} table of:
   √∑         -     divide
     √ó       -   multiply by {100} (vectorises)
                 -> [[100],[50.0,100],[33.33,66.66,100],[25.0,50.0,75.0,100],...]
·∫°            - {P} absolute difference (vectorises) {that}
       ·∏§     - double (vectorises)
        ·ªä    - is insignificant? (vectorises) - i.e. abs(x)<=1
         ¬ß   - sums
          T  - truthy indices
           ·∏¢ - head
```
[Answer]
# [C (gcc)](https://gcc.gnu.org/), 56 bytes
```
i;j;f(n){for(i=j=1;fabs(100.*j/i-n)>.5;j=--j?:++i);j=i;}
```
[Try it online!](https://tio.run/##VVBdb4IwFH33V9yQmLRKlfrB5jrcw7JfMX1gtXVlWg0lGZnhr49doOgkPW0595yT3ivZXsq6NiITmlh60aecmCRLuNDphyM8iiajbGqYpevJUmQJY9nL03hsKN6NqGpjCzimxhIKlwHg1xCqPCtZqN37FhK4xA8hLKIQZivEPASOJ48RC8QMwRFYR/qxXajnXhf7Mp7LzrHyxSbUZzUCb4t6ayXa18iTdQXIzzQf4a7kl8q7RwWb8m22KVeviGUQwv//eeDdOAwgTUPG7lSJtkj46zM486NOmvSt0qknRldGAM6pUdM2rBtPP6IC07qoMXBxV3JY0qSg96xC9jrX1rm9Cc45SjQJhjtga8B96DYWuypCcOG1cZckautjq0FV/0p9SPeuZt81Oxz/AA "C (gcc) ‚Äì Try It Online")
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 45 bytes
```
x=>g=i=>(x-i%69/(y=i>>7)*100)**2<.26?y:g(-~i)
```
[Try it online!](https://tio.run/##DcnRDkNAEAXQr2kys6ziQVPM@hbBbm4jRpCGl/761nk9n/7b78OG9bCLjlP0Ek9xQSCOTotH9X7SJXDuxabIczambLOy6q46kP2Bo9eNIEWDVu5vkgQ86LLrPGWzBkLqCUzM8Q8 "JavaScript (Node.js) ‚Äì Try It Online")
[Answer]
# [Vyxal 3](https://github.com/Vyxal/Vyxal/tree/version-3), 14 bytes
```
‚ÇÖD·µí√∑√ó·πöT»ßd1‚â§·∂§aÍúù
```
[Try it Online!](https://vyxal.github.io/latest.html#WyIiLCIiLCLigoVE4bWSw7fDl+G5mlTIp2Qx4omk4bakYeqcnSIsIiIsIjQiLCIzLjIuMCJd)
Takes an integer argument and returns an integer argument. This is a Vyxal 3 translation of @JonathanAllan‚Äôs Jelly answer. It‚Äôs two bytes longer, partly because the outer modifier returns the result in the transposed reverse of what is needed for this problem.
```
‚ÇÖD·µí√∑√ó·πöT»ßd1‚â§·∂§aÍúù¬≠‚Å°‚Äã‚Äé‚Äé‚Å™‚Å°‚Å™‚Å†‚Å™‚Å°‚Å™‚Äè‚Äè‚Äã‚Å°‚Å†‚Å°‚Äå‚Å¢‚Äã‚Äé‚Äé‚Å™‚Å°‚Å™‚Å†‚Å™‚Å¢‚Å™‚Äè‚Äè‚Äã‚Å°‚Å†‚Å°‚Äå‚Å£‚Äã‚Äé‚Äé‚Å™‚Å°‚Å™‚Å†‚Å™‚Å£‚Å™‚Äè‚Å†‚Äé‚Å™‚Å°‚Å™‚Å†‚Å™‚Å§‚Å™‚Äè‚Äè‚Äã‚Å°‚Å†‚Å°‚Äå‚Å§‚Äã‚Äé‚Äé‚Å™‚Å°‚Å™‚Å†‚Å™‚Å¢‚Å°‚Å™‚Äè‚Äè‚Äã‚Å°‚Å†‚Å°‚Äå‚Å¢‚Å°‚Äã‚Äé‚Äé‚Å™‚Å°‚Å™‚Å†‚Å™‚Å¢‚Å¢‚Å™‚Äè‚Äè‚Äã‚Å°‚Å†‚Å°‚Äå‚Å¢‚Å¢‚Äã‚Äé‚Äé‚Å™‚Å°‚Å™‚Å†‚Å™‚Å¢‚Å£‚Å™‚Äè‚Äè‚Äã‚Å°‚Å†‚Å°‚Äå‚Å¢‚Å£‚Äã‚Äé‚Äé‚Å™‚Å°‚Å™‚Å†‚Å™‚Å¢‚Å§‚Å™‚Äè‚Äè‚Äã‚Å°‚Å†‚Å°‚Äå‚Å¢‚Å§‚Äã‚Äé‚Äé‚Å™‚Å°‚Å™‚Å†‚Å™‚Å£‚Å°‚Å™‚Äè‚Äè‚Äã‚Å°‚Å†‚Å°‚Äå‚Å£‚Å°‚Äã‚Äé‚Äé‚Å™‚Å°‚Å™‚Å†‚Å™‚Å£‚Å¢‚Å™‚Äè‚Å†‚Äé‚Å™‚Å°‚Å™‚Å†‚Å™‚Å£‚Å£‚Å™‚Äè‚Äè‚Äã‚Å°‚Å†‚Å°‚Äå‚Å£‚Å¢‚Äã‚Äé‚Äé‚Å™‚Å°‚Å™‚Å†‚Å™‚Å£‚Å§‚Å™‚Äè‚Å†‚Äé‚Å™‚Å°‚Å™‚Å†‚Å™‚Å§‚Å°‚Å™‚Äè‚Äè‚Äã‚Å°‚Å†‚Å°‚Äå‚Å£‚Å£‚Äã‚Äé‚Äé‚Å™‚Å°‚Å™‚Å†‚Å™‚Å§‚Å¢‚Å™‚Äè‚Äè‚Äã‚Å°‚Å†‚Å°‚Äå¬≠
‚ÇÖ               # ‚Äé‚Å°100
 D              # ‚Äé‚Å¢Triplicate
  ·µí√∑            # ‚Äé‚Å£Outer divide by using (100..1),(100..1)
    √ó           # ‚Äé‚Å§Multiply (by 100)
     ·πö          # ‚Äé‚Å¢‚Å°Reverse
      T         # ‚Äé‚Å¢‚Å¢Transpose
       »ß        # ‚Äé‚Å¢‚Å£Absolute difference with main input
        d       # ‚Äé‚Å¢‚Å§Double
         1‚â§     # ‚Äé‚Å£‚Å°Less than or equal to 1
           ·∂§a   # ‚Äé‚Å£‚Å¢Find first where any true
             Íúù  # ‚Äé‚Å£‚Å£Increment by 1
üíé
```
Created with the help of [Luminespire](https://vyxal.github.io/Luminespire).
[Answer]
# APL+WIN, 35 bytes
Prompts for input:
```
‚åä/(‚éï=(‚åàn-.5),‚åä.5+n‚Üê100√ó√∑m)/m,m‚Üê‚ç≥100
```
[Try it online! Thanks to Dyalog Classic](https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@ob6qvz6O2CcZcQJanP5BlyPWooz3t/6OeLn0NoJitxqOejjxdPVNNHaCQnql2HkiNgcHh6Ye352rq5@rkAvmPejcDhf4DNXL9T@My5ErjMgJiQzBhDCIMDLi4uAA "APL (Dyalog Classic) ‚Äì Try It Online")
[Answer]
# [Python 3](https://docs.python.org/3/), ~~85~~ 72 bytes
-13 bytes since I saw answers to other questions use a function
```
lambda x:[a for a in range(68)for b in range(a)if abs(x-100*b/a)<=.5][0]
```
[try it online!](https://tio.run/##RYxBCsIwEADP5hV7zApqiihS7EtKDxvqaiDZhCSH9vWRePEyMHOYtNdPlGvjSTdPwa4E2zgTcMxA4AQyyful7w/sxf4LoWMgW/R2Gow52gvhczrfltksDRXnGKDsBVxIMVcodXWi@sL3xU9HdUjZSdWsOz0ituEL "Python 3 ‚Äì Try It Online"), or see [all the numbers](https://tio.run/##K6gsycjPM/6fZqvxPycxNyklUaHCKjpRIS2/SCFRITNPoSgxLz1Vw8xCEySShBBJ1MxMU0hMKtao0DU0MNBK0k/UtLHVM42NNoj9r8kVXVCUmVeikaaRo6kJNisHodNQB6hBM/Y/AA "Python 3 ‚Äì Try It Online")
pre-golf:
```
x=int(input())
for a in range(68):        # for all denominators (starting from lowest)
 for b in range(a):        # and numerators (bonus, doesn't let /0 through)
  if abs(x-100*b/a)<=.5:   # is it within rounding range, up or down?
   print(a)                # then print the denominator
   exit()                  # anything else will be bigger
```
credit to [oeis](https://oeis.org/A239525) for sequence and formula
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), 15 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
‚àû.Œî—ÇL—Ç*s/Œ±2zs@√†
```
[Try it online](https://tio.run/##yy9OTMpM/f//Ucc8vXNTLjb5XGzSKtY/t9Goqtjh8IL//w2NAQ) or [verify all outputs](https://tio.run/##ATQAy/9vc2FiaWX/0YJFTj8iIOKGkiAiP07Cqf/iiJ4uzpTRgkzRgipzL8KuzrEyenNAw6D/fSz/).
**Explanation:**
```
‚àû                # Push an infinite positive list: [1,2,3,...]
 .Œî              # Pop and find the first/smallest that's truthy for:
   —ÇL            #  Push a list in the range [1,100]
     —Ç*          #  Multiply each by 100: [100,200,...,10000]
       s/        #  Divide each by the current integer
         Œ±       #  Get the absolute difference of each with the (implicit) input
          2zs@   #  Check for each whether it's <= 0.5:
          2      #   Push 2
           z     #   Pop and push 1/2
            s    #   Swap so the list is at the top
             @   #   >= check
              √†  #  Pop and check if any in the list is truthy
                 # (after which the result is output implicitly)
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 15 bytes
```
‚àû.ŒîD√ùs/—Ç*Œ±2zs@√†
```
[Try it online!](https://tio.run/##ASEA3v9vc2FiaWX//@KIni7OlETDnXMv0YIqzrEyenNAw6D//zE "05AB1E ‚Äì Try It Online")
Explanation:
```
‚àû        Push infinite list
.Œî       Find first item in list where:
    D    Duplicate item
    √ù    Create an array 0-N
    s/   Switch last two and divide
    —Ç*   Multiply by 100
    Œ±    Absolute difference (input is automatically in stack)
    2zs  Push 0.5 before the last item
    @    Compare 0.5 with list (>=)
√†        Check if the list contains 1
```
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 24 bytes
```
ÔºÆŒ∏Ôº©‚åäŒ¶œÜ‚àßŒπŒ¶œÜ¬¨‚Äπ¬∑‚Åµ‚Üî‚ÅªŒ∏‚àï√óŒª¬π‚Å∞‚Å∞Œπ
```
[Try it online!](https://tio.run/##VYvLCsIwEEX3fkWWE4iSIq66EkUQtLjwB9I24EAeNjPp749xJZ7lPfdML1em7ILINb0rDzWOvsCi@82jYGI4OWK4Y8JYI1wwcLOdtdaoY5oBjfrbhsxw80SwO7TDSDlU9t@8EixGnXHF2cMToycIRrVIG4X6Ry/S7WW7hg8 "Charcoal ‚Äì Try It Online") Link is to verbose version of code. Very slow as it does about 1,000 times as much work as necessary. Explanation: Uses the OEIS formula.
```
ÔºÆŒ∏                          First input as a number
     œÜ                      Predefined variable `1000`
    Œ¶                       Filter on implicit range
       Œπ                    Current value
      ‚àß                     Logical And
         œÜ                  Predefined variable `1000`
        Œ¶                   Filter on implicit range
                   Œª        Inner value
                  √ó ¬π‚Å∞‚Å∞     Multiplied by `100`
                 ‚àï          Divided by
                       Œπ    Outer value
              ‚Üî‚Åª            Absolute difference with
                Œ∏           Input number
          ¬¨‚Äπ¬∑‚Åµ              Is less than or equal to `0.5`
   ‚åä                        Take the minimum
  Ôº©                         Cast to string
                            Implicitly print
```
[Answer]
# [R](https://www.r-project.org/), 53 bytes
```
f=\(n,x=1)`if`(all(abs(n-100*(1:x)/x)>.5),f(n,x+1),x)
```
[Try it online!](https://tio.run/##JYpbCoAgEACvs1tWWgRR2Fm0YEGQDXqAt9/SfmYYmFOELD283@FgYJWsQRfIgY8R/HYBN0brCsycsEu4tiMqyl9tUCUUggkXgj7jG4v@GApRXg "R ‚Äì Try It Online")
[Answer]
# [AWK](https://www.gnu.org/software/gawk/manual/gawk.html), 66 bytes
```
{for(;i++<99;)for(j=0;j++<r=i;)if(.5>=(n=$1-100*j/i)&&n>=-.5)next}
```
[Try it online!](https://tio.run/##VZJBjhMxEEX3dYpS1BolzGToKttlF6HDBrbcgQUjdYgCao0EUtSnQOw4HRcJ9Q2biVqW26r3/89vf/r@5Xadp3GlK3H85qftsrt@W@bLM5/nB97sj5sHXuKZpvPybvPn98/Nm1h/xel5WTtznqdB/u2WaVBab9enr8v2MN/fv3U/7PBymsbDKd6XaT7swuSxHKftJbi9jOOr0@t5d3d3OU77x7K7fP7xvN4@fHz/P8YgL2MM@jLGoOtN2Cop55ESq1NmTVRYnIzFqLJkaixKziIkI8tIIuwkyo0kYclcSYJJJAZSKhtJ64BDRUcupAIt1WA1YVgzS1gXjtPOaQWiATZSD9HU7ZJgOilGUuLYZiRNBXgyMKlGjtSwOOgMwywYyIr0OYVczuGdC4Bs0MxhGHONNU6cU6EyslKRvlUcl4SRkjFeOlosVEoNvdKLKQ4bg6MJzA3NGJqxDMB6UDOEthr5rfV@HZq1/8UqIVcVdE1gasZIRTfVgNfap1t4V@8fBYZNUG9TIC1F661zrX@MZiHa0ExDM82D9W7nAsB7M56g5hlC3j@8G@6AV@T1hpvhjksS142F/gI "AWK ‚Äì Try It Online")
]