Skip to content

Instantly share code, notes, and snippets.

defmodule ProjectEuler.Problem4a do
@moduledoc """
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.
Find the largest palindrome made from the product of two 3-digit numbers.
iex> ProjectEuler.Problem4a.solve
906609
"""
@stevedowney
stevedowney / fib.ex
Created August 14, 2014 18:32
Fibonacci number calculator in Elixir.
defmodule Fib do
# Naive implementation
def fib(0), do: 0
def fib(1), do: 1
def fib(n)
when is_integer(n) and n > 1,
do: fib(n-1) + fib(n-2)
@stevedowney
stevedowney / roman_numeral.ex
Last active August 29, 2015 14:05
Roman numeral translator in Elixir.
defmodule RomanNumeral do
@mapping [
{1000, "M"},
{900, "CM"},
{500, "D"},
{400, "CD"},
{100, "C"},
{90, "XC"},
{50, "L"},
{40, "XL"},