张奎福
(吉林省松原市长岭县巨宝山镇 131533)
[a] 不大于a的最大整数
G(r) 半径为r的圆内格点数
g(r) 半径为r的圆上格点数
x格点的横坐标
y格点的纵坐标
r∈Zr是整数
r∉Zr不是整数
∑ 求和
Gauss(1777-1855)问题:中心在原点、半径为r的圆的内部有多少个格点?
原点:x=y=0.
分点:x2=y2≠0.
正点:x×y=0,x2≠y2.
散点:x×y≠0,x2≠y2.
x2+y2=r2.
∵x∈Z,∴x2∈Z,
∵y∈Z,∴y2∈Z,
∴x2+y2=r2∈Z.
∴当r2∉Z时,g(r)=0.
∵g(0)=1,
∴只考虑r2∈Z,r>0.
正点:当r∈Z时,有4个.
x2+y2≤r2.
∵当r2∉Z时,g(r)=0,
∴圆内格点是分层分布的,它们只在半径为r且r2∈Z的同心圆上.
原点:1.
分点:4s.
正点:4[r].
Dim a, b, c, r, s, t, i, l, k
Private Sub CommandButton1_Click()
a = 0: b = 0: c = 1: r = 0: s = 0: t = 0: i = 0: k = 0: TextBox1 = ""
End Sub
Private Sub CommandButton10_Click()
If TextBox1 = 0 Then TextBox1 = "7": GoTo 10
TextBox1 = TextBox1 & "7"
10 End Sub
Private Sub CommandButton11_Click()
If TextBox1 = 0 Then TextBox1 = "8": GoTo 10
TextBox1 = TextBox1 & "8"
10 End Sub
Private Sub CommandButton12_Click()
If TextBox1 = 0 Then TextBox1 = "9": GoTo 10
TextBox1 = TextBox1 & "9"
10 End Sub
Private Sub CommandButton13_Click()
If Int(r) = r Then b = b + 4
If Sqr(a / 2) = s Then b = b + 4
For i = s + 1 To Sqr(a - 1)
k = a - i * i
If Int(Sqr(k)) = Sqr(k) Then b = b + 8
Next i
TextBox1 = b
End Sub
Private Sub CommandButton14_Click()
If TextBox1 <> 0 Then TextBox1 = TextBox1 & "0"
End Sub
Private Sub CommandButton15_Click()
For i = 1 To s:
c = c + 8 * Int(Sqr(a - i * i))
Next i
c = c + 4 * Int(r) - 4 * s * s
TextBox1 = c
End Sub
Private Sub CommandButton2_Click()
If t = 0 Then TextBox1 = TextBox1 & ".": t = 1
End Sub
Private Sub CommandButton3_Click()
a = TextBox1: r = Sqr(a): s = Int(Sqr(a / 2))
TextBox1 = r
End Sub
Private Sub CommandButton4_Click()
If TextBox1 = 0 Then TextBox1 = "1": GoTo 10
TextBox1 = TextBox1 & "1"
10 End Sub
Private Sub CommandButton5_Click()
If TextBox1 = 0 Then TextBox1 = "2": GoTo 10
TextBox1 = TextBox1 & "2"
10 End Sub
Private Sub CommandButton6_Click()
If TextBox1 = 0 Then TextBox1 = "3": GoTo 10
TextBox1 = TextBox1 & "3"
10 End Sub
Private Sub CommandButton7_Click()
If TextBox1 = 0 Then TextBox1 = "4": GoTo 10
TextBox1 = TextBox1 & "4"
10 End Sub
Private Sub CommandButton8_Click()
If TextBox1 = 0 Then TextBox1 = "5": GoTo 10
TextBox1 = TextBox1 & "5"
10 End Sub
Private Sub CommandButton9_Click()
If TextBox1 = 0 Then TextBox1 = "6": GoTo 10
TextBox1 = TextBox1 & "6"
10 End Sub
Private Sub UserForm_Click()
End Sub
r2,G(r).
1,5.10,37.102,317.103,3149.104,31417.105,314197.
106,3141549.107,31416025.108,314159053.109,3141592409.
1010,31415925457.1011,314159264013.1012,3141592649625.
1013,31415926532017.1014,314159265350589.
2*1014,628318530711997.3*1014,942477796083985.
318309886183721-318309886183724,1015-3.
318309886183725,1015+45.