A & B are 5-digit numbers , such that:
i. A*8=B
ii. The concatenation AB is a pandigital number.
Since 12345 *8=98760, A=12345 B=98760 qualifies as a valid solution.
Find all the others
A B
12345 98760
10459 83672
10469 83752
10537 84296
10579 84632
10592 84736
10674 85392
10679 85432
10742 85936
10794 86352
10932 87456
10942 87536
10953 87624
10954 87632
12073 96584
12307 98456
found by
DefDbl A-Z
Dim crlf$, dvsr(300)
Private Sub Form_Load()
Text1.Text = ""
crlf$ = Chr(13) + Chr(10)
Form1.Visible = True
s$ = "1234567890"
h$ = s
Do
a = Val(Left(s, 5))
b = Val(Right(s, 5))
If b = 8 * a And a > 9999 Then Text1.Text = Text1.Text & a & Str(b) & crlf
permute s
DoEvents
Loop Until s = h
End Sub
|
Posted by Charlie
on 2017-05-06 13:35:05 |