#!/bin/sh
awk ' BEGIN { print "(define (min-prefix a b) (list-head a (min (length a) (length b))))"; print "(load-option (quote format))"; } /^\s*$/ { print; next; }  /^%S/ { terms = $3; gsub(","," ",terms); print "(define seq"$2" (list ",terms; next; }  /^%T/ { terms = $3; gsub(","," ",terms); print "  "terms; next; }  /^%U/ { terms = $3; gsub(","," ",terms); print "  "terms; next; } /^%N/ { print "))"; print "(format #t \"%C "$2" Ratios a(n)/A036378(n) converge as: ~s\" (map (lambda (x y) (ratio->float-str x y 6)) (min-prefix seq"$2" seqA036378) (min-prefix seqA036378 seq"$2"))) (newline)"; next; } '


