login
A200980
Concatenate the digits of the natural numbers from 1 to n in order to build up two numbers x and y that minimize the ratio x/y > 0, an integer (leading zeros not admitted).
0
1, 2, 4, 33, 5, 46, 6, 2, 2, 3, 2, 2, 6
OFFSET
1,2
COMMENTS
For n=8 and n=9 we have 12 possible different fractions:
n=8 -> 3456/1728, 3528/1764, 3564/1782, 3654/1827, 4356/2178, 4716/2358, 5436/2718, 5634/2817, 7128/3564, 7164/3582, 8352/4176, 8712/4356.
n=9 -> 13458/6729, 13584/6792, 13854/6927, 14538/7269, 14586/7293, 14658/7329, 15384/7692, 15846/7923, 15864/7932, 18534/9267, 18546/9273, 18654/9327. - Arie Groeneveld, Nov 25 2011
Examples for n=10..13: a(10) = 3 = 161427/53809, a(11) = 2 = 1141826/570913, a(12) = 2 = 11418226/5709113, and a(13) = 6 = 114312678/19052113. - Giovanni Resta, May 31 2016
EXAMPLE
Starting with a(1)=1 we have a(2)=2/1=2, a(3)=12/3=4, a(4)=132/4=33, a(5)=215/43=5, a(6)= 2346/51= 46, a(7)= 3426/571=6, a(8)= 3456/1728 = 2, a(9)= 13458/6729=2.
MAPLE
with(combinat, permute);
P:=proc(i)
local a, c, d, j, k, m, ok, n, t, v, x, y;
v:=[1, 2]; t:=2; lprint(1, 1); lprint(2, 2);
for n from 3 to i do
c:=n;
for j from 1 to floor(1+evalf(log10(n))) do
t:=t+1; v:=[op(v), c-10*trunc(c/10)]; c:=trunc(c/10);
od;
if (t mod 2)=1 then a:=(t+1)/2; else a:=t/2; fi;
c:=permute(v); d:=nops(c); c:=op(c); m:=10^13; ok:=0;
while ok=0 do
for j from 1 to d do
x:=0; for k from 1 to a do x:=10*x+c[j][k]; od;
y:=0; for k from a+1 to t do y:=10*y+c[j][k]; od;
if x>y then if trunc(x/y)=x/y then ok:=1; if x/y<m then m:=x/y; if m=2 then break; fi; fi; fi; fi;
od;
if ok=0 then a:=a+1; fi;
od;
lprint(n, m);
od;
end:
P(10);
CROSSREFS
Sequence in context: A100117 A073888 A114642 * A178811 A099433 A373344
KEYWORD
nonn,base,hard,more
AUTHOR
Paolo P. Lava, Nov 25 2011
EXTENSIONS
a(5) corrected by Arie Groeneveld, Nov 25 2011
a(6)-a(9) from Claudio Meller, Nov 25 2011
a(10)-a(13) from Giovanni Resta, May 31 2016
STATUS
approved