Data update
This commit is contained in:
parent
796d366b97
commit
35bcdeebf8
504 changed files with 7045 additions and 610 deletions
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