solved problem 10 with bash + gnu coreutils

This commit is contained in:
ikselven 2017-06-30 01:20:30 +02:00
parent 18c802a4c5
commit 3a5f81545d

10
10/euler10.bash Executable file
View file

@ -0,0 +1,10 @@
#!/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"