Data update
This commit is contained in:
parent
52a6ef48dd
commit
157b70a810
604 changed files with 14253 additions and 2100 deletions
47
Task/Blum-integer/FutureBasic/blum-integer.basic
Normal file
47
Task/Blum-integer/FutureBasic/blum-integer.basic
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
begin globals
|
||||
UInt32 gPrime1
|
||||
end globals
|
||||
|
||||
local fn IsSemiprime( n as UInt32 ) as BOOL
|
||||
BOOL result = NO
|
||||
UInt32 d = 3, c = 0
|
||||
while d * d <= n
|
||||
while ( n % d = 0 )
|
||||
if ( c == 2 ) then return NO
|
||||
n /= d
|
||||
c += 1
|
||||
wend
|
||||
d += 2
|
||||
wend
|
||||
gPrime1 = n
|
||||
result = ( c == 1 )
|
||||
end fn = result
|
||||
|
||||
void local fn BlumIntegers
|
||||
UInt32 prime2 = 0, n = 3, c = 0
|
||||
|
||||
print @"The first 50 Blum integers:"
|
||||
while ( 1 )
|
||||
if ( fn IsSemiprime( n ) )
|
||||
if ( gPrime1 % 4 == 3 )
|
||||
prime2 = n / gPrime1
|
||||
if ( prime2 != gPrime1 ) && ( prime2 % 4 == 3 )
|
||||
c++
|
||||
if ( c <= 50 )
|
||||
printf @"%4d\b",n
|
||||
if ( c % 10 == 0 ) then print
|
||||
end if
|
||||
if ( c >= 26828 )
|
||||
print : print @"The 26828th Blum integer is: "; n
|
||||
break
|
||||
end if
|
||||
end if
|
||||
end if
|
||||
end if
|
||||
n += 2
|
||||
wend
|
||||
end fn
|
||||
|
||||
fn BlumIntegers
|
||||
|
||||
HandleEvents
|
||||
Loading…
Add table
Add a link
Reference in a new issue