Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
39
Task/Blum-integer/FreeBASIC/blum-integer.basic
Normal file
39
Task/Blum-integer/FreeBASIC/blum-integer.basic
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue