cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A239526 For 0<=n<=100, a(n) is the number of positive responses x such that x/N rounds to n%, minimized over sample size N.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 2, 3, 1, 3, 2, 3, 4, 1, 5, 3, 5, 2, 3, 4, 6, 1, 10, 6, 4, 3, 3, 7, 2, 7, 5, 3, 4, 5, 6, 7, 10, 17, 1, 18, 11, 8, 7, 6, 5, 4, 7, 10, 3, 11, 5, 5, 7, 11, 19, 2, 13, 9, 7, 5, 13, 8, 14, 3, 13, 10, 7, 11, 4, 13, 9, 5, 16, 11, 6, 7, 7, 8, 9, 10, 11, 13, 15, 18, 22, 28, 39, 66, 1
Offset: 0

Views

Author

Patrick D McLean, Mar 21 2014

Keywords

Examples

			a(31)=4 because 4/13=0.31 (2DP).
		

Crossrefs

Cf. A239525 (Minimal sample sizes).

Programs

  • Mathematica
    Table[LinearProgramming[{1, 0}, {{-n/100 + 0.005, 1}, {n/100 + 0.005, -1}}, {0, 0}, {1, 1}, Integers], {n, 0, 100}] // Transpose // Last
  • Python
    from itertools import count
    def A239526(n):
        for y in count(1):
            x, z = divmod(y*((n<<1)+1),200)
            if not z: return x
            x, z = divmod(y*((n<<1)-1),200)
            if (x:=x+bool(z)) and (200*x+y)//(y<<1) == n:
                return x # Chai Wah Wu, Jun 28 2025