Each set of lines shows the three numbers, followed by a line with the numbers of unique prime divisors of each, then a line with the numbers factored into primes. The first n is 1042404. In some instances below, the n has 6 unique prime divisors, as the program looked for at least 5.
1042404 1042405 1042406
5 5 5
2^2 * 3 * 11 * 53 * 149 5 * 7 * 13 * 29 * 79 2 * 17 * 23 * 31 * 43
3460280 3460281 3460282
5 5 5
2^3 * 5 * 19 * 29 * 157 3 * 11 * 23 * 47 * 97 2 * 7^2 * 17 * 31 * 67
3818828 3818829 3818830
5 5 5
2^2 * 13 * 23 * 31 * 103 3 * 7 * 17 * 19 * 563 2 * 5 * 43 * 83 * 107
3998664 3998665 3998666
5 5 5
2^3 * 3^2 * 19 * 37 * 79 5 * 11 * 23 * 29 * 109 2 * 7 * 47 * 59 * 103
4638984 4638985 4638986
5 5 5
2^3 * 3 * 7 * 53 * 521 5 * 13 * 23 * 29 * 107 2 * 11 * 37 * 41 * 139
4991964 4991965 4991966
5 5 5
2^2 * 3 * 47 * 53 * 167 5 * 11 * 17 * 19 * 281 2 * 7 * 23 * 37 * 419
5540248 5540249 5540250
5 5 5
2^3 * 7 * 19 * 41 * 127 11 * 13 * 17 * 43 * 53 2 * 3 * 5^3 * 83 * 89
5617820 5617821 5617822
6 5 5
2^2 * 5 * 13 * 17 * 31 * 41 3 * 11 * 37 * 43 * 107 2 * 7 * 29 * 101 * 137
5701254 5701255 5701256
5 5 5
2 * 3 * 13 * 19 * 3847 5 * 7 * 29 * 41 * 137 2^3 * 11 * 17 * 37 * 103
5715500 5715501 5715502
5 5 5
2^2 * 5^3 * 7 * 23 * 71 3 * 11 * 31 * 37 * 151 2 * 13 * 17 * 67 * 193
5964958 5964959 5964960
5 5 5
2 * 23 * 31 * 47 * 89 7 * 11 * 13 * 59 * 101 2^5 * 3 * 5 * 17^2 * 43
6488690 6488691 6488692
6 5 5
2 * 5 * 13 * 19 * 37 * 71 3 * 11 * 23 * 83 * 103 2^2 * 7 * 29 * 61 * 131
6772050 6772051 6772052
5 5 5
2 * 3^2 * 5^2 * 101 * 149 11 * 13 * 23 * 29 * 71 2^2 * 7 * 17 * 41 * 347
6794084 6794085 6794086
5 5 5
2^2 * 11 * 17 * 31 * 293 3 * 5 * 23 * 47 * 419 2 * 13 * 43 * 59 * 103
7237384 7237385 7237386
5 5 5
2^3 * 7 * 11 * 31 * 379 5 * 19 * 29 * 37 * 71 2 * 3^2 * 13 * 157 * 197
7453964 7453965 7453966
5 5 5
2^2 * 7 * 41 * 43 * 151 3 * 5 * 47 * 97 * 109 2 * 13 * 19 * 79 * 191
7459088 7459089 7459090
5 5 5
2^4 * 7 * 13 * 47 * 109 3 * 11 * 37 * 41 * 149 2 * 5 * 17^2 * 29 * 89
7745318 7745319 7745320
5 5 5
2 * 7 * 47 * 79 * 149 3^2 * 17 * 23 * 31 * 71 2^3 * 5 * 11 * 29 * 607
7757034 7757035 7757036
5 5 5
2 * 3 * 71 * 131 * 139 5 * 11 * 13 * 19 * 571 2^2 * 7 * 29 * 41 * 233
7993194 7993195 7993196
5 5 5
2 * 3 * 11 * 163 * 743 5 * 7 * 31 * 53 * 139 2^2 * 17 * 41 * 47 * 61
8083634 8083635 8083636
5 5 5
2 * 13 * 29 * 71 * 151 3 * 5 * 7 * 167 * 461 2^2 * 11 * 17 * 101 * 107
8153430 8153431 8153432
5 5 5
2 * 3 * 5 * 463 * 587 11 * 13 * 23 * 37 * 67 2^3 * 7 * 19 * 79 * 97
8168194 8168195 8168196
5 5 5
2 * 17 * 37 * 43 * 151 5 * 7 * 19 * 71 * 173 2^2 * 3 * 59 * 83 * 139
8273628 8273629 8273630
5 5 5
2^2 * 3^2 * 11 * 17 * 1229 7 * 13 * 23 * 59 * 67 2 * 5 * 43 * 71 * 271
8340834 8340835 8340836
5 5 5
2 * 3 * 73 * 137 * 139 5 * 23 * 29 * 41 * 61 2^2 * 7 * 37 * 83 * 97
8340980 8340981 8340982
5 5 5
2^2 * 5 * 29 * 73 * 197 3 * 11 * 19 * 53 * 251 2 * 13 * 17 * 113 * 167
8414756 8414757 8414758
5 5 5
2^2 * 7 * 29 * 43 * 241 3^2 * 13 * 23 * 53 * 59 2 * 11 * 19 * 41 * 491
8486994 8486995 8486996
5 5 5
2 * 3 * 31 * 103 * 443 5 * 11 * 17 * 29 * 313 2^2 * 7^2 * 19 * 43 * 53
8698898 8698899 8698900
5 5 5
2 * 13 * 29 * 83 * 139 3 * 11 * 23 * 73 * 157 2^2 * 5^2 * 7 * 17^2 * 43
8722634 8722635 8722636
5 5 5
2 * 19 * 53 * 61 * 71 3 * 5 * 23 * 131 * 193 2^2 * 13 * 43 * 47 * 83
8758904 8758905 8758906
5 5 5
2^3 * 7 * 11 * 59 * 241 3 * 5 * 19 * 73 * 421 2 * 13 * 23 * 97 * 151
Dim fct(20, 1), crlf$
Private Sub Form_Load()
Text1.Text = ""
crlf$ = Chr(13) + Chr(10)
Form1.Visible = True
For np2 = 1 To 99999999
DoEvents
ppf = pf: pf = f
f = factor(np2)
If ppf >= 5 And pf >= 5 And f >= 5 Then
Text1.Text = Text1.Text & np2 - 2 & Str(np2 - 1) & Str(np2) & crlf
Text1.Text = Text1.Text & ppf & Str(pf) & Str(f) & crlf
For n = np2 - 2 To np2
fi = factor(n)
For i = 1 To fi
If i > 1 Then Text1.Text = Text1.Text & " *"
Text1.Text = Text1.Text & Str(fct(i, 0))
If fct(i, 1) > 1 Then Text1.Text = Text1.Text & "^" & LTrim(Str(fct(i, 1)))
Next
Text1.Text = Text1.Text & " "
Next
Text1.Text = Text1.Text & crlf & crlf
DoEvents
ct = ct + 1
If ct > 30 Then Exit For
End If
Next np2
Text1.Text = Text1.Text & " done"
End Sub
Function factor(num)
diffCt = 0: good = 1
nm1 = Abs(num): If nm1 > 0 Then limit = Sqr(nm1) Else limit = 0
If limit <> Int(limit) Then limit = Int(limit + 1)
dv = 2: GoSub DivideIt
dv = 3: GoSub DivideIt
dv = 5: GoSub DivideIt
dv = 7
Do Until dv > limit
GoSub DivideIt: dv = dv + 4 '11
GoSub DivideIt: dv = dv + 2 '13
GoSub DivideIt: dv = dv + 4 '17
GoSub DivideIt: dv = dv + 2 '19
GoSub DivideIt: dv = dv + 4 '23
GoSub DivideIt: dv = dv + 6 '29
GoSub DivideIt: dv = dv + 2 '31
GoSub DivideIt: dv = dv + 6 '37
If INKEY$ = Chr$(27) Then s$ = Chr$(27): Exit Function
Loop
If nm1 > 1 Then diffCt = diffCt + 1: fct(diffCt, 0) = nm1: fct(diffCt, 1) = 1
factor = diffCt
Exit Function
DivideIt:
cnt = 0
Do
q = Int(nm1 / dv)
If q * dv = nm1 And nm1 > 0 Then
nm1 = q: cnt = cnt + 1: If nm1 > 0 Then limit = Sqr(nm1) Else limit = 0
If limit <> Int(limit) Then limit = Int(limit + 1)
Else
Exit Do
End If
Loop
If cnt > 0 Then
diffCt = diffCt + 1
fct(diffCt, 0) = dv
fct(diffCt, 1) = cnt
End If
Return
End Function
|
Posted by Charlie
on 2015-07-02 15:49:37 |