◼
Link to the instruction video: https://youtu.be/EpmFIBps9VU
◼
AOPS Link
Out[]=
Use logarithm to convert exponential function to linear scale
In[]:=
NumberLinePlot[{Range[17],Range[7]*Log2[5]},PlotLegends{TraditionalForm@Log2[2^m],TraditionalForm@Log2[5^n]}]
Out[]=
Also we notice
In[]:=
Log2[5.]
Out[]=
2.32193
This number is between 2 and 3. Thus there are at most 3 and at least 2 integers between and . Because 5 is irrational, there is no known formula to find closed form for how many integers no greater than . Lets take a look how the sizes of gap distributed by direct counting.
n·5
log
2
(n+1)·5
log
2
log
2
n·5
log
2
In[]:=
IntCount[k_]:=Floor[(k+1)*Log2[5]]-Ceiling[k*Log2[5]]+1
In[]:=
ListPlot[Table[IntCount[k],{k,1,50}],FillingBottom,Ticks{Automatic,{2,3}}]
Out[]=
To find how many integers is no greater than for each k, we have
(k+1)·5
log
2
In[]:=
(accumList=Accumulate[Table[IntCount[k],{k,1,867}]])//Short
Out[]//Short=
{2,4,7,9,11,14,16,18,21,23,25,28,30,32,839,1983,1985,1987,1990,1992,1994,1997,1999,2001,2004,2006,2008,2011,2013}
Notice that the problem asks us to find the number of n’s such that there are 3 integers between and . Because we already know the least number of integers in a gap is 2, we can simply compute difference between and all integers no greater than to find the desired result.
Wrap up everything above into a Manipulate function.
n·5
log
2
(n+1)·5
log
2
2n
(n+1)·5
log
2
Wrap up everything above into a Manipulate function.
In[]:=
Manipulate[all=Table[IntCount[k],{k,1,n}];last=Accumulate[all][[-1]];StringForm["There are `1` pairs of integers (m,n) \nare there such that 1 <= m <= `2` \nsuch that 5^n < 2^m < 2^m+2 < 5^(n+1)",last-2*n,last],{n,6,867,1},SaveDefinitionsTrue]
Out[]=
Print valid candidates for (m,n)
In[]:=
Dynamic[resultN=(Position[all,3]//Flatten);resultM=Ceiling[resultN*Log[2,5]]//Flatten;Short[Transpose@{resultM,resultN}]]
Out[]=