There is only one value for n, shown below, above the row of hyphens, together with n^2 and n^3.
For m, all values below 1000 are shown (just ignore the first line where m = n, contrary to the specific rule) below the row of hyphens.
69 4761 328509 Smallest and only value for n
---------------
69 4761 328509
128 16384 2097152 Smallest value for m
203 41209 8365427
302 91204 27543608
327 106929 34965783
366 133956 49027896
398 158404 63044792
467 218089 101847563
542 293764 159220088
591 349281 206425071
593 351649 208527857
598 357604 213847192
633 400689 253636137
643 413449 265847707
669 447561 299418309
690 476100 328509000
747 558009 416832723
759 576081 437245479
903 815409 736314327
923 851929 786330467
943 889249 838561807
DefDbl A-Z
Private Sub Form_Load()
Text1.Text = ""
crlf$ = Chr(13) + Chr(10)
For n = 9 To 999
n2$ = LTrim(Str(n * n))
n3$ = LTrim(Str(n * n * n))
combo$ = n2$ + n3$
If Len(combo$) = 10 Then
good = 1
For i = 1 To Len(combo$)
If InStr(Mid(combo$, i + 1), Mid(combo$, i, 1)) > 0 Then good = 0: Exit For
Next
If good Then Text1.Text = Text1.Text & Str(n) & " " & n2$ & " " & n3$ & crlf$: Form1.Visible = True: DoEvents
End If
Next
Text1.Text = Text1.Text & "---------------" & crlf$
For n = 9 To 999
n2$ = LTrim(Str(n * n))
n3$ = LTrim(Str(n * n * n))
combo$ = n2$ + n3$
ct = 0
For i = 1 To Len(combo$)
If InStr(combo$, Mid(combo$, i, 1)) = i Then ct = ct + 1
Next
If ct = 10 Then Text1.Text = Text1.Text & Str(n) & " " & n2$ & " " & n3$ & crlf$: Form1.Visible = True: DoEvents
Next
End Sub
|
Posted by Charlie
on 2014-05-10 15:55:51 |