anchor.diff:    ;;
     ;; What is the sum of the numbers on the diagonals in a 1001 by 1001 spiral
     ;; formed in the same way?
  -  (let* ((size 1001)
  -         (spiral (number-spiral size)))
  -    (+ (iterate (for x :from 0 :below size) ; \
  -                (for y :from 0 :below size)
  -                (summing (aref spiral y x)))
  -       (iterate (for x :from (1- size) :downto 0) ; /
  -                (for y :from 0 :below size)
  -                (summing (aref spiral y x)))
  -       ;; don't double-count the center...
  -       (- (aref spiral (truncate size 2) (truncate size 2))))))
  +  (iterate (for size :from 1 :to 1001 :by 2)
  +           (summing (apply #'+ (number-spiral-corners size)))))
   
   (defun problem-29 ()
     ;; Consider all integer combinations of a^b for 2 ≤ a ≤ 5 and 2 ≤ b ≤ 5:
  
positive.code: (test p55 (is (= 249 (problem-55))))
  (test p56 (is (= 972 (problem-56))))
  (test p57 (is (= 153 (problem-57))))
  
  (test p74 (is (= 402 (problem-74))))
  (test p145 (is (= 608720 (problem-145))))
  
  
  ;; (run! :euler)
  
negative.code:     (for expansion = (1+ i))
      (counting (> (digits-length (numerator expansion))
                   (digits-length (denominator expansion))))))
  
  (defun problem-58 ()
    ;; Starting with 1 and spiralling anticlockwise in the following way, a square
    ;; spiral with side length 7 is formed.
    ;;
    ;; 37 36 35 34 33 32 31
    ;; 38 17 16 15 14 13 30
    ;; 39 18  5  4  3 12 29
    ;; 40 19  6  1  2 11 28
    ;; 41 20  7  8  9 10 27
    ;; 42 21 22 23 24 25 26
    ;; 43 44 45 46 47 48 49
    ;;
    ;; It is interesting to note that the odd squares lie along the bottom right
    ;; diagonal, but what is more interesting is that 8 out of the 13 numbers
    ;; lying along both diagonals are prime; that is, a ratio of 8/13 ≈ 62%.
    ;;
    ;; If one complete new layer is wrapped around the spiral above, a square
    ;; spiral with side length 9 will be formed. If this process is continued,
    ;; what is the side length of the square spiral for which the ratio of primes
    ;; along both diagonals first falls below 10%?
    (labels ((score (value)
               (if (primep value) 1 0))
             (primes-in-layer (size)
               (sum (number-spiral-corners size) :key #'score)))
      (iterate
        (for size :from 3 :by 2)
        (for count :from 5 :by 4)
        (sum (primes-in-layer size) :into primes)
        (for ratio = (/ primes count))
        (finding size :such-that (< ratio 1/10)))))
  
  
  
  
  
  (defun problem-74 ()
  