diff --git a/1/euler001.bash b/1/euler001.bash new file mode 100755 index 0000000..17d7c2a --- /dev/null +++ b/1/euler001.bash @@ -0,0 +1,11 @@ +#!/bin/bash + +declare -i sum=0 + +for i in {1..999}; do + { + echo $i | grep -E "*[05]$" || factor $i | grep -P "\d+:(\s\d)*(\s[35])(\s\d*)*$"; + } > /dev/null && sum=$(( $sum + $i )) +done + +echo "$sum"