Skip to content

Instantly share code, notes, and snippets.

(ns my-project.magic)
;; Take each digit in a number and square it, then add the sums together. Keep doing this recursively.
;; The sequence will either go to one or recurse infinitely.
;; Create a method that returns a boolean value to determine whether a number is happy
(defn number->digits
"Given a number return a sequence of digits that comprise the number"
[number]
(let [string-digits (map str (seq (str number)))]
(map #(Integer/parseInt %) string-digits)))
@johnkelly
johnkelly / keybase.md
Created October 9, 2014 03:19
Keybase.io

Keybase proof

I hereby claim:

  • I am johnkelly on github.
  • I am jkelly (https://keybase.io/jkelly) on keybase.
  • I have a public key whose fingerprint is 3243 3BCA 44FE 14C7 92A7 FF31 C818 0466 C099 B430

To claim this, I am signing this object: