| 网站首页 | 业界新闻 | 小组 | 交易 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛

问题点数：0 回复次数：4

(偶数)(方根内的素数构成的素数和对个数)（总素数和对个数）
210 2  19
420 2  30
630 4  41
840 4  51
1050 5  57
1260 4  68
1470 6  73
1680 4  83
1890 7  91
2100 6  97
2310 7  114
2520 3  112
2730 9  128
2940 6  122
3150 4  138
3360 8  138
3570 10  154
3780 7  149
3990 5  163
4200 5  165
4410 6  171
4620 6  190
4830 8  189

(偶数)(方根内的素数构成的素数和对个数)（总素数和对个数）
6 0  1
216 1  13
426 3  21
636 4  28
846 4  32
1056 4  44
1266 3  42
1476 5  51
1686 4  56
1896 5  63
2106 6  71
2316 7  66
2526 2  68
2736 8  82
2946 5  87
3156 3  85
3366 8  105
3576 8  96
3786 6  96
3996 3  99
4206 4  105
4416 5  111
4626 5  110
4836 7  121

Private Function fenjieyinzi(sa As String) As String
Dim x, a, b, k As String
a = Val(sa)

x = 3
If a <= 1 Or a > Int(a) Then
If a = 1 Then
fenjieyinzi = "它既不是质数，也不是合数"

Else
MsgBox "error"
End If

Else

Do While a / 2 = Int(a / 2) And a >= 4

If b = 0 Then
fenjieyinzi = fenjieyinzi & "2"
b = 1
Else
fenjieyinzi = fenjieyinzi & "*2"
End If
a = a / 2
k = a

Loop

Do While a > 1
Do While x <= Sqr(a)
Do While a / x = Int(a / x) And a >= x * x

If b = 0 Then
fenjieyinzi = fenjieyinzi & x
b = 1
Else
fenjieyinzi = fenjieyinzi & "*" & x
End If
a = a / x
Loop

x = x + 2
Loop

k = a
a = 1
Loop

If b = 1 Then
fenjieyinzi = fenjieyinzi & "*" & k
Else
fenjieyinzi = "这是一个质数"
End If

End If

End Function

Private Sub Command1_Click()
Dim a, b
a = Val(Text1)
q = Val(Text3)
Do While a <= q
s = 0
m = Sqr(a)
a1 = 3
Do While a1 <= m
b = a - a1
c = fenjieyinzi(Val(a1))
d = fenjieyinzi(Val(b))
If InStr(c, "*") = 0 And InStr(d, "*") = 0 Then
s = s + 1

Else
s = s
End If
a1 = a1 + 2
Loop
a2 = a1
s1 = s
Do While a2 <= a / 2
b1 = a - a2
c1 = fenjieyinzi(Val(a2))
d1 = fenjieyinzi(Val(b1))

If InStr(c1, "*") = 0 And InStr(d1, "*") = 0 Then
s1 = s1 + 1

Else
s1 = s1
End If

a2 = a2 + 2

Loop

Text2 = Text2 & CStr(a) & " " & CStr(s) & "  " & CStr(s1) & vbCrLf
Print a, s, s1

a = a + 210
Loop

Combo1.Text = "(偶数)(方根内的素数构成的素数和对个数)（总素数和对个数）" & vbCrLf & Text2.Text

End Sub

Private Sub Command2_Click()
Text1 = ""
Text2 = ""
Text3 = ""
Combo1 = ""
Form1.Cls
End Sub

（比如6=3+3，我们就说6有1对哥德巴赫猜想解，而10=3+7=5+5，我们就说10有两对哥德巴赫猜想解，就是两个“1+1”。）

[此贴子已经被作者于2020-11-8 22:04编辑过]

210 2  19
840 4  51
1680 4  83

y=0.4281*x^0.7095，

[此贴子已经被作者于2020-11-9 22:41编辑过]

216 1  13
846  4  32
1686  4  56

y=0.2917*x^0.7036，

218 1  7
848 1  15
1688 2  26

220 0  9
850 3  25
1690 1  37

244 3  9
874 2  19
1714 2  27

Private Sub Command1_Click()
Dim a, b, c
a = Trim(Text1)
b = 2 * a
B1 = Sqr(b)
c = b ^ 0.5664
d = 0.4024 * c
x = qssgs(Trim(B1))
y = 0.328 * x ^ (-0.7341)
q = b * y / 4
q1 = q / d
q2 = q1 * 10 ^ 13
Text2 = q2
End Sub

Private Sub Command2_Click()
Text1 = ""
Text2 = ""
End Sub

Private Function qssgs(sa As String) As String
Dim a, b, c
a = Trim(sa)
b = Sqr(a)

If a > 10 ^ 25 Then
a1 = Log(a) / Log(10)
b3 = (1.74136140824861 ^ ((1.06415 * Exp(-0.00175 * (a1 - 0.65 * (a1 - 21)))) ^ a1)) ^ a1
c = (a + (b3 + 4) * b) / Log(a)
ElseIf a > 10000000 Then
a1 = Log(a) / Log(10)
b2 = Exp(1.033 * a1)
B1 = 0.159 * b2
b4 = (1.74136140824861 ^ (1.8 * a1)) / 4.9
b5 = (B1 + b4) / 2
c = (a + (b5 + 4) * b) / Log(a)
ElseIf a >= 10000 Then
a1 = Log(a) / Log(10)
b3 = (56 * a1 ^ 3 - 741 * a1 ^ 2 + 3367 * a1 - 5142) / 6
c = (a + (b3 + 4) * b) / Log(a)
ElseIf a >= 1000 Then
c = (a + 4 * b) / Log(a)
ElseIf a >= 500 Then
c = (a + 2 * b) / Log(a)
ElseIf a >= 100 Then
c = (a + b) / Log(a)
Else

c = a / Log(a)
End If
d = a / c
D1 = a - Int(d)
c1 = a & "内的素数个数下限为 " & Int(c)

qssgs = c

End Function

244 3  9
874 2  19
1714 2  27

[此贴子已经被作者于2020-11-14 19:50编辑过]

• 5
• 1/1页
• 1