Example pairs like (1/27)=0.(OverBar[037]) and (1/37)="0."(OverBar["027"]).

Math 4303

Helmut Knaust, Department of Mathematical Sciences, UTEP, El Paso TX 79968
hknaust@utep.edu

Last Edits: 2/12/2025

DigitRepresentation[fraction_,base_:10]:=Module[{nr=fraction,b,d1,d2,d3,fp,d,pos},b=base;d1=IntegerString[IntegerPart[nr],b];nr=nr-IntegerPart[nr];fp={};d={};
While[Not[MemberQ[fp,nr]],fp=Append[fp,nr];nr=b nr;d=Append[d,IntegerPart[nr]];nr=nr-IntegerPart[nr];];
pos=Position[fp,nr][[1,1]];d2=If[pos>1,d[[1;;pos-1]],{}];d3=d[[pos;;Length[d]]];
Print[If[b==10,"","("],d1,".",If[d2=={},"",IntegerString[FromDigits[d2,b],b,Length[d2]]],If[d3=={}||d3=={0},"",OverBar[IntegerString[FromDigits[d3,b],b,Length[d3]]]],If[b==10,"",")"],If[b==10,"",Subscript["",b]]]]

Some examples

DigitRepresentation[1/27]
DigitRepresentation[1/37]

This works since both numbers have the same number of digits and ...

27 37

DigitRepresentation[1/123]
DigitRepresentation[1/813]

123 813

11099889 90090991

yields the example:

DigitRepresentation[1/11099889]
DigitRepresentation[1/90090991]

A complete list of all examples up to a product of (10^69)-1

Can you explain why there can’t be examples with an even exponent?

TableForm[Select[Table[{k,Select[Transpose[{Divisors[10^k-1],(10^k-1)/Divisors[10^k-1]}],Length[#[[1]]<#[[2]]&&IntegerDigits[#[[1]]]]==Length[IntegerDigits[#[[2]]]]&]},{k,3,69,2}],Not[#[[2]]=={}]&],TableHeadings->{None,{"Exponent","Pairs"}}]