ocaml: phase 5.1 euler36.ml baseline (sum of double-base palindromes <= 1000 = 1772)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 23s

Numbers that read the same in base 10 and base 2:

  1, 3, 5, 7, 9, 33, 99, 313, 585, 717
  sum = 1772

Implementation:
  pal_dec n        check decimal palindrome via index walk
  to_binary n      build binary string via mod 2 / div 2 stack
  pal_bin n        check binary palindrome
  euler36 limit    scan 1..limit-1, sum where both palindromes

Real PE36 uses 10^6 (answer 872187). 1000 takes ~9 minutes on
contended host but stays within reasonable budget for the
spec-level evaluator.

123 baseline programs total.
This commit is contained in:
2026-05-10 00:26:46 +00:00
parent 37f7405dcf
commit ed8aaf8af7
3 changed files with 48 additions and 0 deletions

View File

@@ -407,6 +407,12 @@ _Newest first._
binary search tree (`type 'a tree = Leaf | Node of 'a * 'a tree *
'a tree`) with insert + in-order traversal. Tests parametric ADT,
recursive match, List.append, List.fold_left.
- 2026-05-10 Phase 5.1 — euler36.ml baseline (sum of double-base
palindromes ≤ 1000 = 1772). Numbers that read the same in base 10
and base 2: 1, 3, 5, 7, 9, 33, 99, 313, 585, 717. Sum = 1772.
Real PE36 uses 10^6 (answer 872187); 1000 takes ~9 minutes on
contended host but fits within 480s timeout * inner-iteration
cost ratio. 123 baseline programs total.
- 2026-05-10 Phase 5.1 — euler40_small.ml baseline (Champernowne
digit-product at 1, 10, 100, 1000 = 1*1*5*3 = 15). Builds the
Champernowne string until ≥1500 chars; tracks length separately