40 lines
933 B
Plaintext
40 lines
933 B
Plaintext
Dim Shared As Uinteger Prime1
|
|
Dim As Uinteger n = 3, c = 0, Prime2
|
|
|
|
Function isSemiprime(n As Uinteger) As Boolean
|
|
Dim As Uinteger d = 3, c = 0
|
|
While d*d <= n
|
|
While n Mod d = 0
|
|
If c = 2 Then Return False
|
|
n /= d
|
|
c += 1
|
|
Wend
|
|
d += 2
|
|
Wend
|
|
Prime1 = n
|
|
Return c = 1
|
|
End Function
|
|
|
|
Print "The first 50 Blum integers:"
|
|
Do
|
|
If isSemiprime(n) Then
|
|
If Prime1 Mod 4 = 3 Then
|
|
Prime2 = n / Prime1
|
|
If (Prime2 <> Prime1) And (Prime2 Mod 4 = 3) Then
|
|
c += 1
|
|
If c <= 50 Then
|
|
Print Using "####"; n;
|
|
If c Mod 10 = 0 Then Print
|
|
End If
|
|
If c >= 26828 Then
|
|
Print !"\nThe 26828th Blum integer is: " ; n
|
|
Exit Do
|
|
End If
|
|
End If
|
|
End If
|
|
End If
|
|
n += 2
|
|
Loop
|
|
|
|
Sleep
|