#!/usr/bin/env bash
cd /c/Users/Owner/Documents/Prime\ Hunter || exit 1
out=verified_primes_pln.txt
cat > "$out" <<'EOF'
Verified Mersenne Prime Chain and PLN Values
Generated on: $(date)

EOF
for p in 272559681 12804503237 601539092458 28259532842289 1327596504495118 62368776178428408 2930004883881648640; do
  echo "=== p=$p ===" >> "$out"
  ./mersenne_gen.exe --info "$p" >> "$out"
  omega=$(./mersenne_gen.exe --info "$p" | grep -m1 "omega" | awk '{print $3}')
  echo >> "$out"
  echo "Verification:" >> "$out"
  ./mersenne_gen.exe --verify-pln "$p" "$omega" | sed -n '1,15p' >> "$out"
  echo >> "$out"
done
echo "Saved $out"
