Files
rose-ash/lib
giles fb0e83d3a1
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 24s
ocaml: phase 5.1 palindrome_sum.ml baseline (sum of 3-digit palindromes = 49500)
let palindrome_sum lo hi =
    let total = ref 0 in
    for n = lo to hi do
      if is_pal n then total := !total + n
    done;
    !total

  palindrome_sum 100 999 = 49500

There are 90 three-digit palindromes (form aba; 9 choices for a, 10
for b). Average value 550, sum 49500.

Companion to palindrome.ml (predicate-only) and paren_depth.ml.

127 baseline programs total.
2026-05-10 01:29:52 +00:00
..