Jump to content

Truncatable primes: Difference between revisions

m
Forth - simplified code
m (Forth - simplified code)
m (Forth - simplified code)
Line 1,209:
drop false exit
then
dup 10>r
10
begin
dup2dup 3 pick <>
while
2 pick over2dup mod
dup 3 pickr> = if
2drop 2dropdrop false exit
then
dup prime? invert if
2drop 2dropdrop false exit
then
rot drop swap>r
10 *
repeat
2drop droprdrop true ;
 
: right_truncatable_prime? ( n -- flag )
1,777

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.