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.

A224926 Numerator of lexicographically least fraction f satisfying floor(f * 10^A055642(n)) = n.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 3, 4, 9, 1, 1, 1, 2, 1, 2, 1, 3, 2, 4, 1, 3, 2, 3, 6, 1, 4, 3, 2, 5, 3, 5, 8, 1, 8, 5, 4, 3, 5, 9, 2, 5, 3, 7, 4, 5, 6, 8, 12, 25, 1, 14, 9, 7, 6, 5, 9, 4, 7, 13, 3, 8, 5, 7, 9, 13, 2, 19, 11, 9, 7, 5, 8, 11, 20, 3, 10, 7, 11, 19, 4, 9, 14, 5
Offset: 1

Views

Author

Paul Tek, Apr 20 2013

Keywords

Comments

1 <= a(n) <= n.
For any reduced fraction u/v in the interval [1/10..1[, a(floor(u/v*10^k))=u for k sufficiently large.

Examples

			The fractions f satisfying floor(f*100)=42, are, in lexicographical order: 3/7, 6/14, 8/19, 9/21, 11/26, 12/28, 14/33, 15/35, 16/38, 17/40, 18/42, 19/45, 20/47, 21/49...
Hence, a(42)=numerator(3/7)=3.
		

Crossrefs

Cf. A224927 (denominators), A055642, A002487.

Programs

  • PARI
    a224926(n) =\
    local(a=0,b=1,c,d,e=1,f=0,x=1);\
    while(x<=n, x=x*10);\
    while(1, c=a+e;d=b+f;\
    if(c/d < n/x, a=c;b=d,\
    if(c/d >= (n+1)/x, e=c;f=d,\
    return(c))))