Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #37 Jan 29 2025 17:59:34
%S 2,4,33,5,46,6,2,2,3,2,2,6,6,6,6,6,6,6,6,6,4,2,2
%N a(n) = smallest positive integer ratio x/y for numbers x,y that together have the same digits as all numbers from 1 to n (leading zeros are not allowed).
%C a(n) = 1 for n in A380642, in particular a(122) = 1 is the first term equal 1. We also have a(n) =/= 2, 5, or 8 (mod 9) when n == 1 (mod 3), and a(n) =/= 8 (mod 9) when n == 2, 3, 5, or 6 (mod 9). - _Max Alekseyev_, Jan 29 2025
%e 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.
%e For n=8 and n=9 we have 12 possible different fractions:
%e 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.
%e 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
%e 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
%e a(14) = 6 = 1171331046/195221841, a(15) = 6 = 43113114126/7185519021, a(16) = 6 = 431131141266/71855190211, a(17) = 6 = 1184110411266/197351735211, a(18) = 6 = 43111148107266/7185191351211, a(19) = 6 = 431511114781266/71918519130211, a(20) = 6 = 1124111491872606/187351915312101, a(21) = 6 = 11841114811272606/1973519135212101, a(22) = 4 = 111181166112121244/27795291528030311, a(23) = 2 = 1911636343422222202/955818171711111101, a(24) = 2 = 19116343486222222202/9558171743111111101. - _Max Alekseyev_, Jan 29 2025
%p with(combinat,permute);
%p P:=proc(i)
%p local a,c,d,j,k,m,ok,n,t,v,x,y;
%p v:=[1,2]; t:=2; lprint(1,1); lprint(2,2);
%p for n from 3 to i do
%p c:=n;
%p for j from 1 to floor(1+evalf(log10(n))) do
%p t:=t+1; v:=[op(v),c-10*trunc(c/10)]; c:=trunc(c/10);
%p od;
%p if (t mod 2)=1 then a:=(t+1)/2; else a:=t/2; fi;
%p c:=permute(v); d:=nops(c); c:=op(c); m:=10^13; ok:=0;
%p while ok=0 do
%p for j from 1 to d do
%p x:=0; for k from 1 to a do x:=10*x+c[j][k]; od;
%p y:=0; for k from a+1 to t do y:=10*y+c[j][k]; od;
%p 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;
%p od;
%p if ok=0 then a:=a+1; fi;
%p od;
%p lprint(n,m);
%p od;
%p end:
%p P(10);
%Y Cf. A380642.
%K nonn,base,hard,more,changed
%O 2,1
%A _Paolo P. Lava_, Nov 25 2011
%E a(5) corrected by _Arie Groeneveld_, Nov 25 2011
%E a(6)-a(9) from _Claudio Meller_, Nov 25 2011
%E a(10)-a(13) from _Giovanni Resta_, May 31 2016
%E Edited, a(1) removed, a(14)-a(24) added by _Max Alekseyev_, Jan 29 2025