Prove the following theorem:
For any string of decimal digits, representing number M there is an integer n such that the number N=2^n begins with the string M.
Find a value of N for M=2023?
For part 2, to find N for M=2023:
n=10; N=sym(2)^n; sN=char(N);
while ~isequal(sN(1:4),'2023')
n=n+1; N=N*2;
sN=char(N);
end
n
N
finds
n =
10103
N =
2023234366085676444933399521968795355709734933253646107175806386280720454169608246180718629029785087
3929144005399911750604095081019309893371501482061296676277785326927384771368145259516185675589884443
4066315672743389968406134742126845815975072278622715399316594655988198976857816496218732423448702916
9006676583019566520764773791077262812377542808879558612596256950274154859870250596198119209027976409
1003246203442292936187278647377875884003518222185044822170337148006823871765218107053852047775526074
3676437749278971991089237988240462522572630474449818205466891678860637843367872056815156718358887456
3484554043561667066977941702372608501051243945521801540197606102931169349031473001602804059165400926
8303790396944788284005545783040270253410658413528729734811887611611299480388649111082915008149649169
0885905112713344574900042269920362298457512644716559148120172812792334570700077729691779393969438745
0217746353725651598684493196253355337289288370927965579021371367257715871949084358416465174610717322
1854662618432788654386936011687817788465539931297348084307332623084471921972866707410944484150920650
2628780898694116717716319501538209083369540684279146487235542460850196260201079779937925229017262015
4637820572353165250703574728817973584734230871609743552595677134627580175557658959679360447652250921
6341370491746151888796730210279588669352528399517038349791028889090000871282164216637716978687120416
7221769863588566999056856850387275250242763227133572036736203818508573495758688717885007255621951574
4185482762580189879841731279825964933674678562090624238225117017220530841366827302043046486140416256
1281803404242683857227176806840469065877390086138008046894403081471246917146168421723435854847892796
9084473198949331035966752340387788571727227848178482615932009127566150098323157324701488727637097235
3869322012272358311875849938131328405841660458893047700481062266127305995481906323648108126923431088
5156591135447414541051997369059765271729276828050935576049747468516283118124019825182650518785416756
6377162170615220083757951926030440303800371846490566717642581384734254005036038484612822843517115033
3302458502702312360970714348811338740491628204977972890287888554920906021708843465789754349934015085
2411777605340088095243934243098069629640356265964014441144954164003190683478709580115134614840321177
2465388867885355084509867676173409719304766330119691150103873227829496320175879115451936208671052329
7742670030787207229621538192054992475404558236026097153211097582256261279072871118902946333906897136
6017032775859511743585436834626228254453759462835949589960835889360108587535208915532165208696461261
5083351412468581077124406792973899837292016811767399214383880712777501601178133093340968714137208860
6750114329234585271317951875273215428202001019788606194550440969531655753372089332393465944126735943
8364468607388055778075145350010465723007201357069940712644375591633104212706323478238935421544868140
1897536815616054628752046673690877458421808951767213221338196144131872816759603954268579551711972959
703157018829865979879458785580232902443008
N is 3042 digits long.
For less precision of N:
n=10;l=log10(2^n);test=floor(1000*(10^(l-floor(l))));
while test~=2023
n=n+1;l=l+log10(2);
test=floor(1000*(10^(l-floor(l))));
end
n
10^(l-floor(l))
disp(['x 10^' char(string(floor(l)))])
giving
n =
10103
ans =
2.0232343684131
x 10^3041
The answer of 2.0232343684131 x 10^3041 for N has lost the validity of its last 5 digits by the built-up inaccuracy of double precision numbers having migrated that far to the left by successive additions. The above exact calculation shows N equals approximately 2.0232343660856 x 10^3041.
The proof for part 1 must involve the fact that the common log of 2 is irrational, combined with an pigeonhole principle, but I can't formulate it as well as Steve Herman has explained it.
|
Posted by Charlie
on 2023-05-22 12:40:34 |