diff options
author | Tom Barrett <tom@tombarrett.xyz> | 2021-06-30 17:20:46 +0200 |
---|---|---|
committer | Tom Barrett <tom@tombarrett.xyz> | 2021-06-30 17:20:46 +0200 |
commit | ee57979cfaf37aaf1d7c72155a3f65cc02caa286 (patch) | |
tree | fb1867efd7d9eae3daf8ce89e3de752fa983307b |
-rw-r--r-- | p1.lisp | 10 | ||||
-rw-r--r-- | p2.lisp | 14 | ||||
-rw-r--r-- | p3.lisp | 7 |
3 files changed, 31 insertions, 0 deletions
@@ -0,0 +1,10 @@ +(setq sum 0) +(loop for i from 0 to 1001 do + (if (eq (mod i 3) 0) + (setq sum (+ sum i)) + (if (eq (mod i 5) 0) + (setq sum (+ sum i)) + ) + ) +) +(print sum) @@ -0,0 +1,14 @@ +(setq a (list 1 2)) +(setq l 0) +(loop while (< l 4000000) do + (setq l (apply '+ (last a 2))) + (nconc a (list l)) +) + +(setq s 0) +(loop for i in a do + (if (eq (mod i 2) 0) + (setq s (+ s i)) + ) +) +(print s) @@ -0,0 +1,7 @@ +(setq n 13195) + +(dotimes (i n) + (if (eq (mod i n) 0) + (print i) + ) +) |