Data update
This commit is contained in:
parent
796d366b97
commit
35bcdeebf8
504 changed files with 7045 additions and 610 deletions
38
Task/Blum-integer/EasyLang/blum-integer.easy
Normal file
38
Task/Blum-integer/EasyLang/blum-integer.easy
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
fastfunc semiprim n .
|
||||
d = 3
|
||||
while d * d <= n
|
||||
while n mod d = 0
|
||||
if c = 2
|
||||
return 0
|
||||
.
|
||||
n /= d
|
||||
c += 1
|
||||
.
|
||||
d += 2
|
||||
.
|
||||
if c = 1
|
||||
return n
|
||||
.
|
||||
.
|
||||
print "The first 50 Blum integers:"
|
||||
n = 3
|
||||
numfmt 0 4
|
||||
repeat
|
||||
prim1 = semiprim n
|
||||
if prim1 <> 0
|
||||
if prim1 mod 4 = 3
|
||||
prim2 = n div prim1
|
||||
if prim2 <> prim1 and prim2 mod 4 = 3
|
||||
c += 1
|
||||
if c <= 50
|
||||
write n
|
||||
if c mod 10 = 0 ; print "" ; .
|
||||
.
|
||||
.
|
||||
.
|
||||
.
|
||||
until c >= 26828
|
||||
n += 2
|
||||
.
|
||||
print ""
|
||||
print "The 26828th Blum integer is: " & n
|
||||
48
Task/Blum-integer/Quackery/blum-integer.quackery
Normal file
48
Task/Blum-integer/Quackery/blum-integer.quackery
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
600000 eratosthenes
|
||||
|
||||
[ dup sqrt
|
||||
tuck dup * = ] is exactsqrt ( n --> n b )
|
||||
|
||||
[ dup isprime iff
|
||||
[ drop false ] done
|
||||
dup 4 mod 1 != iff
|
||||
[ drop false ] done
|
||||
dup exactsqrt iff
|
||||
[ 2drop false ] done
|
||||
temp put
|
||||
3 from
|
||||
[ 4 incr
|
||||
index temp share > iff
|
||||
[ drop false end ]
|
||||
done
|
||||
index isprime not if done
|
||||
dup index /mod 0 != iff
|
||||
drop done
|
||||
isprime not if done
|
||||
drop index end ]
|
||||
temp release ] is blum ( n --> n )
|
||||
|
||||
[ dup blum
|
||||
over echo
|
||||
say " = "
|
||||
dup echo
|
||||
say " * "
|
||||
/ echo cr ] is echoblum ( n --> )
|
||||
|
||||
say "The First 50 Blum integers:"
|
||||
cr cr
|
||||
[] 1 from
|
||||
[ 4 incr
|
||||
index blum if
|
||||
[ index join ]
|
||||
dup size 50 = if end ]
|
||||
witheach echoblum
|
||||
cr
|
||||
say "The 26828th Blum integer:"
|
||||
cr cr
|
||||
0 1 from
|
||||
[ 4 incr
|
||||
index blum if 1+
|
||||
dup 26828 = if
|
||||
[ drop index end ] ]
|
||||
echoblum
|
||||
Loading…
Add table
Add a link
Reference in a new issue