Sha256: 2acf850f387b1cb29784974a256a07b90b41e0a42fe593934f62e85c4e151838
Contents?: true
Size: 541 Bytes
Versions: 396
Compression:
Stored size: 541 Bytes
Contents
;;; difference-of-squares.el --- Difference of Squares (exercism) ;;; Commentary: ;;; Code: (eval-when-compile (require 'cl)) (defun sum-of-squares (n) "Square of sums of N." (reduce #'+ (mapcar #'(lambda (i) (expt i 2)) (number-sequence 1 n)))) (defun square-of-sums (n) "Sum of squares of N." (expt (reduce #'+ (number-sequence 1 n)) 2)) (defun difference (n) "Difference of squares pertaining to N." (- (square-of-sums n) (sum-of-squares n))) (provide 'difference-of-squares) ;;; difference-of-squares.el ends here
Version data entries
396 entries across 396 versions & 1 rubygems