/kaprekar

An algoritm to find the Kaprekar constant

Primary LanguageElixirMIT LicenseMIT

Introduction

Kaprekar is an Elixir module to decompose a four-digit number whose digits are not all the same until it finds the Kaprekar constant.

For information about this constant, visit the Kaprekar's routine on Wikipedia

Usage

Kaprekar.decompose(1234)
[1234, 3087, 8352, 6174]