Skip to content

Instantly share code, notes, and snippets.

@hnw
Created September 18, 2014 07:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hnw/7cc27eee0711eac8058d to your computer and use it in GitHub Desktop.
Save hnw/7cc27eee0711eac8058d to your computer and use it in GitHub Desktop.
last50digits = 55723761467908866712060720593684978725896677308273
findCandidates xs = filter ((lastDigits==).(`mod` m).(^101).read) candidates
where
candidates = [c:x | c<-['0'..'9'], x<-xs]
len = length $ head candidates
m = 10^len
lastDigits = last50digits `mod` m
main = print . take 50 $ iterate findCandidates [""]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment