find all numbers patterns that add up to the sum of all numbers

find all numbers patterns that add up to the sum of all numbers

this vba code under  will find all  6 numbers that = 120 

instance  you add  the successful lotto numbers three,10,12,15,39,41 and it = 120 

and you favor to know what are all  6  numbers that add up to 120 

you are going to get an excel of 89714 strains of 6 numbers that add up to 120 

and on line 37707 is the wining numbers lotto numbers :  three,10,12,15,39,41 

SO now you favor to determine what number of time the successful numbers display out of 89714 strains

the run my script on simply three,10,12,15,39,41 and located this : 

five and six simplest as soon as on line  37707  

most sensible four numbers discovered 17 and 16 instances 

 

three,12,15,41     17 instances
three,10,15,41     17 instances
three,12,15,39     17 instances
10,12,15,39   16 instances

 

most sensible three numbers discovered 200,199,196 and 193 instances 

three,10,41 200  instances
three,12,39 199 instances
three,12,41 196 instances
three,15,39 193 instances

 

so i than ran the code to find all Patten’s of five 6 four and three numbers out of 1..45  that = 120 in the  89714 strains 

and located this ; 

for six and five  most commonly confirmed as soon as simplest 

however four and three 

discovered four  patten numbers 

nine,16,24,25      17 instances
6,22,23,24      17  instances 
nine,16,23,25      17  instances 
7,15,23,28      16  instances 

discovered three patten numbers 

2,10,39              202 instances
eight,15,29              194 instances
6,17,30               193 instances
6,19,20              193 instances
1,16,24              189 instances 

discovered 2 pairs numbers 

five,22     1894 instances
10,11    1864  instances
four,31      1816  instances
four,11      1791  instances
2,37       1755  instances

 

then I discovered all the 6 numbers in the previous draw  that = 120  and were given a four Patten hit 

 

7 nine 14 18 35 37 120
nine 16 17 23 25 30 120
five 13 14 24 29 35 120
nine 12 16 18 29 36 120
2 three 21 26 27 41 120

and  discovered I were given a success with four numbers patterns  with nine,16,23,25

 four numbers discovered patten  

nine,16,24,25      17 instances
6,22,23,24      17  instances 
nine,16,23,25      17  instances 
7,15,23,28      16  instances 

 

 

 

 

vba code

Option Explicit
Option Base 1

Const MinA As Integer = 1
Const MaxF As Integer = 45

Sub List_Comb()
Dim A As Integer, B As Integer, C As Integer, D As Integer, E As Integer, f As Integer
Dim n As Long
Application.ScreenUpdating = False
Cells.Delete
Cells(1, 1).Select
n = zero
For A = MinA To MaxF – four
For B = A + 1 To MaxF – three
For C = B + 1 To MaxF – 2
For D = C + 1 To MaxF – 1
For E = D + 1 To MaxF
For f = E + 1 To MaxF
If A + B + C + D + E + f = 120 Then
ActiveCell.Value = A & “,” & B & “,” & C & “,” & D & “,” & E & “,” & f
ActiveCell.Offset(1, zero).Select
End If
Next f
Next E
Next D
Next C
Next B
Next A
Application.ScreenUpdating = True
End Sub

Updated: May 10, 2018 — 6:03 pm

Leave a Reply

Your email address will not be published. Required fields are marked *