This repository has been archived on 2024-01-26. You can view files and clone it, but cannot push or open issues or pull requests.
project-euler/10/euler10.bash
2017-06-30 01:20:30 +02:00

10 lines
232 B
Bash
Executable file

#!/usr/bin/bash
# I have yet to see this script coming to an end...
declare -i primeSum=0
for num in {2..2000000}; do
[[ "$(factor $num | cut -d " " -f2)" != $num ]] || primeSum=$(( $primeSum + $num ))
done
echo "$primeSum"