Jump to content

Truncatable primes: Difference between revisions

m
Line 191:
}
 
isTruncatablePrime: @(nums){-> all nums => isPrime }
 
MaxLeft: 0
Line 197:
 
loop [rangeBy 3 1000000 2] @(n){
if [isTruncatablePrime [leftTrunc n]] {-> MaxLeft: n }
if [isTruncatablePrime [rightTrunc n]] {-> MaxRight: n }
}
 
print "Max Left-Truncatable Prime found (<1000000): " + MaxLeft
print "Max Right-Truncatable Prime found (<1000000): " + MaxRight</lang>
</lang>
 
{{out}}
1,532

edits

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