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.

Showing 1-1 of 1 results.

A303612 a(n) = min{denominator(r) with r in R} and R = {0 <= r rational <= 1 and [r*k] = n}. Here k = 10^(floor(log_10(n))+1) and [x] = floor(x+1/2) + ceiling((2*x-1)/4) - floor((2*x-1)/4) - 1.

Original entry on oeis.org

1, 7, 4, 3, 5, 2, 5, 3, 4, 7, 10, 9, 8, 15, 7, 13, 19, 6, 11, 16, 5, 14, 9, 13, 17, 4, 19, 11, 18, 7, 10, 13, 19, 3, 29, 17, 11, 19, 8, 18, 5, 17, 12, 7, 9, 11, 13, 15, 21, 35, 2, 35, 21, 15, 13, 11, 9, 7, 12, 17, 5, 18, 8, 19, 11, 17, 29, 3, 19, 13, 10
Offset: 0

Views

Author

Luca Petrone, Apr 27 2018

Keywords

Comments

a(n) is the smallest denominator of a fraction that, when rounded to d digits after the decimal point, is equal to 0.n, where d is the number of digits of n, and the rounding convention applied is that a number whose fractional part is 1/2 is rounded to the nearest even integer.
a(k-n) = a(n), where k is the first power of 10 exceeding n.
The sequence [A297367(n)/a(n), n = 10^(k-1)..10^(k)-1] is a subsequence of the Farey sequence A006842/A006843 of order ceiling((2/3)*10^k). For example, the terms a(1)..a(9) are the denominators of {1/7, 1/4, 1/3, 2/5, 1/2, 3/5, 2/3, 3/4, 6/7}; this sequence of fractions is a subsequence of the Farey sequence of order ceiling((2/3)*10^1) = 7, i.e., F7 = {0/1, 1/7, 1/6, 1/5, 1/4, 2/7, 1/3, 2/5, 3/7, 1/2, 4/7, 3/5, 2/3, 5/7, 3/4, 4/5, 5/6, 6/7, 1/1}.
With the exception of n in {1, 2, 4, 13, 16}, r(n) = A297367(n)/a(n) is in the Farey series of order n (row n of A006842/A006843). - Peter Luschny, May 19 2018

Examples

			The table below shows the different rational numbers which satisfy the requirements of the definition. The denominators of the first rational number in each row constitute the sequence. Note that the round function is not implemented uniformly in popular software. For example, Mathematica matches our definition, while Maple's round function would return incorrect values.
.
  |                     |  decimal  |     round(10*r)
n | rational numbers r  |   value   | Mathematica | Maple
--+---------------------+-----------+-------------+------
0 | 0/1                 | 0.0000000 |      0      |   0
1 | 1/7, 1/8, 1/9, 1/10 | 0.1428571 |      1      |   1
2 | 1/4, 1/5, 1/6, 2/9  | 0.2500000 |      2      | * 3 *
3 | 1/3, 2/7, 3/10      | 0.3333333 |      3      |   3
4 | 2/5, 3/7, 3/8, 4/9  | 0.4000000 |      4      |   4
5 | 1/2                 | 0.5000000 |      5      |   5
6 | 3/5, 4/7, 5/8, 5/9  | 0.6000000 |      6      |   6
7 | 2/3, 5/7, 7/10      | 0.6666667 |      7      |   7
8 | 3/4, 4/5, 5/6, 7/9  | 0.7500000 |      8      |   8
9 | 6/7, 7/8, 8/9, 9/10 | 0.8571429 |      9      |   9
		

References

  • C. F. Gauss, Theorematis arithmetici demonstratio nova, Societati regiae scientiarum Gottingensis, Vol. XVI., January 15, 1808, pp. 5-7, section 4-5.
  • L. Graham and Donald E. Knuth and Oren Patashnik, Concrete mathematics: a foundation for computer science (Second Edition), Addison-Wesley Publishing Company, 1994, pp. 86-101.
  • Kenneth E. Iverson, A Programming Language, John Wiley And Sons, Inc., 1962 (4th printing 1967), pp. 11-12.
  • Takeo Kamizawa, Note on the Distance to the Nearest Integer, Faculty of Physics, Astronomy and Informatics, Nicolaus Copernicus University, Toruń, Poland, 2016.
  • A. M. Legendre, Théorie des nombres (deuxième édition), 1808.
  • D. Zuras, M. Cowlishaw, R. M. Grow, et al., IEEE Standard for Floating-Point Arithmetic, Std 754(tm)-2008, ISBN 978-0-7381-5753-5, August 28, 2008, p. 16, sections 4.3.1-4.3.3.

Crossrefs

Programs

  • Maple
    r := proc(n) local nint, k, p, q; k := 10^(ilog10(n)+1);
    nint := m -> floor(m + 1/2) + ceil((2*m-1)/4) - floor((2*m-1)/4) - 1;
    for p from 1 to k do for q from p+1 to k do if nint(p*k/q) = n then return p/q fi od od; 0/1 end:
    a := n -> denom(r(n)): seq(a(n), n=0..99); # Peter Luschny, May 19 2018
  • Mathematica
    a = {1};
    For[i = 1, i <= 100, i++,
    nmax = 10^(Floor[Log[10, i]] + 1);
    r = i/nmax;
    For[n = 1, n <= nmax, n++,
    If[Round[Round[n r]/n, 1/nmax] == r,
    a = Flatten[Append[a, n]];
    Break[];
    ]]]
Showing 1-1 of 1 results.