Sha256: c39af2e7527791902b3b0c6111a9c10e9ef81294c2049aa7905e83bd22d4d15f

Contents?: true

Size: 358 Bytes

Versions: 31

Compression:

Stored size: 358 Bytes

Contents

;;; armstrong-numbers.el --- armstrong-numbers Exercise (exercism)

;;; Commentary:

;;; Code:

(defun armstrong-p (n)
  (let* ((digits (mapcar #'(lambda (d) (- d ?0)) (string-to-list (int-to-string n))))
	 (p (length digits)))
    (= n (apply '+ (mapcar #'(lambda (d) (expt d p)) digits)))))

(provide 'armstrong-numbers)
;;; armstrong-numbers.el ends here

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/elisp/exercises/armstrong-numbers/example.el
trackler-2.2.1.179 tracks/elisp/exercises/armstrong-numbers/example.el
trackler-2.2.1.178 tracks/elisp/exercises/armstrong-numbers/example.el
trackler-2.2.1.177 tracks/elisp/exercises/armstrong-numbers/example.el
trackler-2.2.1.176 tracks/elisp/exercises/armstrong-numbers/example.el
trackler-2.2.1.175 tracks/elisp/exercises/armstrong-numbers/example.el
trackler-2.2.1.174 tracks/elisp/exercises/armstrong-numbers/example.el
trackler-2.2.1.173 tracks/elisp/exercises/armstrong-numbers/example.el
trackler-2.2.1.172 tracks/elisp/exercises/armstrong-numbers/example.el
trackler-2.2.1.171 tracks/elisp/exercises/armstrong-numbers/example.el
trackler-2.2.1.170 tracks/elisp/exercises/armstrong-numbers/example.el
trackler-2.2.1.169 tracks/elisp/exercises/armstrong-numbers/example.el
trackler-2.2.1.167 tracks/elisp/exercises/armstrong-numbers/example.el
trackler-2.2.1.166 tracks/elisp/exercises/armstrong-numbers/example.el
trackler-2.2.1.165 tracks/elisp/exercises/armstrong-numbers/example.el
trackler-2.2.1.164 tracks/elisp/exercises/armstrong-numbers/example.el
trackler-2.2.1.163 tracks/elisp/exercises/armstrong-numbers/example.el
trackler-2.2.1.162 tracks/elisp/exercises/armstrong-numbers/example.el
trackler-2.2.1.161 tracks/elisp/exercises/armstrong-numbers/example.el
trackler-2.2.1.160 tracks/elisp/exercises/armstrong-numbers/example.el