Skip to content

Instantly share code, notes, and snippets.

@rugyoga
Last active July 21, 2022 08:53
Find the 100th palindromic number that is divisible by 3
1
|> Stream.iterate(fn n -> n + 1 end)
|> Stream.filter(fn n -> s = Integer.to_string(n); s == String.reverse(s) end)
|> Stream.filter(fn n -> rem(n, 3) == 0 end)
|> Enum.at(99)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment