Skip to content

Instantly share code, notes, and snippets.

@mikamix
Created December 28, 2013 18:32
Show Gist options
  • Save mikamix/8162534 to your computer and use it in GitHub Desktop.
Save mikamix/8162534 to your computer and use it in GitHub Desktop.
euler4(Answer) :-
findall(X, palindromes(X), Palindromes),
max_list(Palindromes, Answer).
palindromes(Z) :-
between(100, 999, X),
between(X, 999, Y),
Z is X * Y,
is_palindrome(Z).
is_palindrome(Number) :-
number_chars(Number, List),
reverse(List, List).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment