Data update
This commit is contained in:
parent
35bcdeebf8
commit
74c69a0df6
2427 changed files with 31826 additions and 3468 deletions
40
Task/Blum-integer/BASIC256/blum-integer.basic
Normal file
40
Task/Blum-integer/BASIC256/blum-integer.basic
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
global Prime1
|
||||
n = 3
|
||||
c = 0
|
||||
|
||||
print "The first 50 Blum integers:"
|
||||
while True
|
||||
if isSemiprime(n) then
|
||||
if Prime1 % 4 = 3 then
|
||||
Prime2 = n / Prime1
|
||||
if (Prime2 <> Prime1) and (Prime2 % 4 = 3) then
|
||||
c += 1
|
||||
if c <= 50 then
|
||||
print rjust(string(n), 4);
|
||||
if c % 10 = 0 then print
|
||||
end if
|
||||
if c >= 26828 then
|
||||
print : print "The 26828th Blum integer is: "; n
|
||||
exit while
|
||||
end if
|
||||
end if
|
||||
end if
|
||||
end if
|
||||
n += 2
|
||||
end while
|
||||
end
|
||||
|
||||
function isSemiprime(n)
|
||||
d = 3
|
||||
c = 0
|
||||
while d*d <= n
|
||||
while n % d = 0
|
||||
if c = 2 then return false
|
||||
n /= d
|
||||
c += 1
|
||||
end while
|
||||
d += 2
|
||||
end while
|
||||
Prime1 = n
|
||||
return c = 1
|
||||
end function
|
||||
Loading…
Add table
Add a link
Reference in a new issue