solved problem 10 with bash + gnu coreutils
This commit is contained in:
parent
18c802a4c5
commit
3a5f81545d
1 changed files with 10 additions and 0 deletions
10
10/euler10.bash
Executable file
10
10/euler10.bash
Executable 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"
|
Reference in a new issue