Determine the value of a smallest positive integer N greater than 1 such that the base ten expansion of N1/N contains precisely six zeroes immediately following the decimal point. How about seven zeroes?
Extra Challenge: A non computer program solution.
DefDbl A-Z
Dim crlf$
Private Sub Form_Load()
ChDir "C:\Program Files (x86)\DevStudio\VB\projects\flooble"
Text1.Text = ""
crlf$ = Chr(13) + Chr(10)
Form1.Visible = True
DoEvents
goalLT = 0.000001
factor = 0.5
n = 10000
Do
prevn = n
p = n ^ (1 / n)
frac = p - Int(p)
prevdir = drct
If frac >= goalLT Then
drct = 1
n = Int(n * (1 + factor) + 0.5)
Else
drct = -1
n = Int(n * (1 - factor) + 0.5)
End If
If drct = -prevdir Then factor = factor / 2
Text1.Text = Text1.Text & n & Str(p) & Str(factor) & crlf
DoEvents
Loop Until Abs(n - prevn) < 2
Text1.Text = Text1.Text & crlf & " done"
End Sub
and a similar program with goalLT = 0.0000001 narrow down the search to allow manual exploration with the extra precision of UBASIC:
16626517^(1/16626517) = 1.0000010000000422...
16626518^(1/16626518) = 1.000000999999985677...
190660034^(1/190660034) = 1.0000001000000001398...
190660035^(1/190660035) = 1.0000000999999996428...
The two answers are bolded above.
|
Posted by Charlie
on 2014-10-02 10:47:53 |