Skip to content

Instantly share code, notes, and snippets.

@maxsu
Created February 11, 2019 14:34
Show Gist options
  • Save maxsu/abdc8ffd40e2c8bda03a5890303c51d8 to your computer and use it in GitHub Desktop.
Save maxsu/abdc8ffd40e2c8bda03a5890303c51d8 to your computer and use it in GitHub Desktop.
t = [0..9]
t8 = [(a,b,c,d,e,f,g,h) | a<-t,b<-t,c<-t,d<-t,e<-t,f<-t,g<-t, h<-t]
f::(Integer, Integer, Integer, Integer,Integer, Integer, Integer, Integer) -> Bool
f (a,b,c,d,e,f,g,h) =
a^h + b^g + c^f + d^e + e^d + f^c + g^b + h^a == 10^8*h + 10^7*g + 10^6*f + 10^5*e + 1000*d + 100*c + 10*b + a
s = filter f t8
main = print s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment