Last active
July 21, 2022 08:53
-
-
Save rugyoga/2d454fd14410063280f7844983a50da5 to your computer and use it in GitHub Desktop.
Find the 100th palindromic number that is divisible by 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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