Guest User

Untitled

a guest
Jul 19th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. window.onload = function() {
  2.  
  3. // List of palindrome numbers between 100 and 1000.
  4. var p = filter(nt.palindrome(1000), curry(op["<"],100));
  5.  
  6. // Remove all the non-prime numbers.
  7. var pp = filter(p, nt.isPrime);
  8.  
  9. // Remove all the numbers that dont have embedded
  10. // prime values (Assuming three digit numbers).
  11. var pe = filter(p, function(n) {
  12. var ns = ""+n;
  13. var p0 = parseInt(ns[0]+ns[1]);
  14. var p1 = parseInt(ns[1]);
  15. var p2 = parseInt(ns[1]+ns[2]);
  16. return nt.isPrime(p0) && nt.isPrime(p1) && nt.isPrime(p2);
  17. });
  18.  
  19. alert(pe);
  20. }
Add Comment
Please, Sign In to add comment