erste Ergebnisse
17.11.2009 09:43:35
Erich
Hi Erhard,
diese 26 Lösungen kommen recht flott.
Es werden etliche mehr, ich habe schon mindestens drei mal so viele gesehen.
Jedenfalls hoffe ich, dass das Lösungen in deinem Sinne sind:
| A | B | C | D |
1 | 6140852739 | 1023456789 | 1023456789 | 1023568794 |
2 | 6140853729 | 1023456789 | 1023456789 | 1023569784 |
3 | 6140853792 | 1023456789 | 1023456789 | 1023569847 |
4 | 6140873592 | 1023456789 | 1023456789 | 1023589647 |
5 | 6140978523 | 1023456789 | 1023456789 | 1023694578 |
6 | 6140978532 | 1023456789 | 1023456789 | 1023694587 |
7 | 6142053798 | 1023456789 | 1023456789 | 1024769853 |
8 | 6142073598 | 1023456789 | 1023456789 | 1024789653 |
9 | 6142079583 | 1023456789 | 1023456789 | 1024795638 |
10 | 6143052879 | 1023456789 | 1023456789 | 1025768934 |
11 | 6143082579 | 1023456789 | 1023456789 | 1025798634 |
12 | 6143257809 | 1023456789 | 1023456789 | 1025973864 |
13 | 6145230798 | 1023456789 | 1023456789 | 1027946853 |
14 | 6145237809 | 1023456789 | 1023456789 | 1027953864 |
15 | 6145270398 | 1023456789 | 1023456789 | 1027986453 |
16 | 6145820739 | 1023456789 | 1023456789 | 1028536794 |
17 | 6145823709 | 1023456789 | 1023456789 | 1028539764 |
18 | 6145978302 | 1023456789 | 1023456789 | 1028694357 |
19 | 6145978320 | 1023456789 | 1023456789 | 1028694375 |
20 | 6147029583 | 1023456789 | 1023456789 | 1029745638 |
21 | 6147032598 | 1023456789 | 1023456789 | 1029748653 |
22 | 6147052398 | 1023456789 | 1023456789 | 1029768453 |
23 | 6149753802 | 1023456789 | 1023456789 | 1032469857 |
24 | 6149753820 | 1023456789 | 1023456789 | 1032469875 |
25 | 6149780523 | 1023456789 | 1023456789 | 1032496578 |
26 | 6149780532 | 1023456789 | 1023456789 | 1032496587 |
Und das hat sie erzeugt:
Option Explicit
Sub aaa10()
Dim a As Double, b As Double, c As Double, d As Double, zz As Long
With Application
.Calculation = xlCalculationManual
.EnableEvents = False
End With
For b = 1023456789 To 2194786530#
If Chk09(b) Then
For c = 1023456789 To 2743198650#
If Chk09(c) Then
For d = 1023456789 To 4389610275#
If Chk09(d) Then
a = 3 * b + 2 * c + d
If Len(CStr(a)) > 10 Then Exit For
If Chk09(a) Then
zz = zz + 1
With Cells(zz, 1)
.Select
.Resize(, 4) = Array(a, b, c, d)
End With
'Application.StatusBar = "d " & CStr(d) & " a " & CStr(a)
DoEvents
End If
End If
Next d
End If
Next c
End If
Next b
With Application
.Calculation = xlCalculationAutomatic
.EnableEvents = True
End With
'Application.StatusBar = False
End Sub
Function Chk09(dblT As Double) As Boolean
Dim strT As String, ii As Byte, arr(0 To 9) As Boolean
strT = CStr(dblT)
For ii = 1 To 10
If arr(Mid(strT, ii, 1)) Then Exit Function
arr(Mid(strT, ii, 1)) = True
Next ii
Chk09 = True
End Function
Etwas möchte ich dich jetzt noch fragen: Wie kommst du eigentlich zu diesen Aufgaben?
Denkst du sie dir selbst aus? Gibt es einen praktischen Hintergrund?
Rückmeldung wäre nett! - Grüße von Erich aus Kamp-Lintfort