diff --git a/Solutions/Summation_of_primes.sh b/Solutions/Summation_of_primes.sh new file mode 100755 index 0000000..588736c --- /dev/null +++ b/Solutions/Summation_of_primes.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +arr=() +read num +for i in $(seq 1 $num); do read t && arr+=($t); done +for i in "${arr[@]}"; do factor $(seq 2 $i) | awk 'NF==2{print $2}' | awk '{s+=$1} END {print s}'; done