Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- window.onload = function() {
- // List of palindrome numbers between 100 and 1000.
- var p = filter(nt.palindrome(1000), curry(op["<"],100));
- // Remove all the non-prime numbers.
- var pp = filter(p, nt.isPrime);
- // Remove all the numbers that dont have embedded
- // prime values (Assuming three digit numbers).
- var pe = filter(p, function(n) {
- var ns = ""+n;
- var p0 = parseInt(ns[0]+ns[1]);
- var p1 = parseInt(ns[1]);
- var p2 = parseInt(ns[1]+ns[2]);
- return nt.isPrime(p0) && nt.isPrime(p1) && nt.isPrime(p2);
- });
- alert(pe);
- }
Add Comment
Please, Sign In to add comment