In "A Mathematician's Apology", G. H. Hardy wrote:
"There are just four numbers, after unity, which are the sums
of the cubes of their digits: 153,370,371,407."
Clearly, he referred to base 10.
What are such numbers in base-8?
Provide your list in octal system.
DefDbl A-Z
Dim crlf$
Private Sub Form_Load()
Form1.Visible = True
Text1.Text = ""
crlf = Chr(13) + Chr(10)
For a = 0 To 7
For b = 0 To 7
For c = 0 To 7
For d = 0 To 7
v = ((a * 8 + b) * 8 + c) * 8 + d
tot = a * a * a + b * b * b + c * c * c + d * d * d
If v = tot Then Text1.Text = Text1.Text & a & b & c & d & crlf
Next
Next
Next
Next
Text1.Text = Text1.Text & crlf & " done"
End Sub
shows
0000
0001
0134
0205
0463
0660
0661
which of course includes the trivial 0 and 1.
|
Posted by Charlie
on 2018-05-30 10:25:17 |