Skip to content

Instantly share code, notes, and snippets.

@jwworth
Last active January 29, 2016 23:03
Show Gist options
  • Save jwworth/9315df793666708bfe8c to your computer and use it in GitHub Desktop.
Save jwworth/9315df793666708bfe8c to your computer and use it in GitHub Desktop.
From One End to the Other (Elm)
import Graphics.Element exposing (show)
import Array exposing (..)
import String exposing (..)
magicNumber : Array Int
magicNumber =
let
isNumber number =
String.right 1 (toString(number)) == "6" &&
(String.append "6" (String.dropRight 1 (toString(number))))
== toString(number * 4)
in
Array.filter isNumber (initialize 100000 (\n -> n * 2))
main = show magicNumber
-- Array.fromList [153846]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment