added coreutils + bash solution for problem 1
This commit is contained in:
parent
3a5f81545d
commit
c83ec18a1e
1 changed files with 11 additions and 0 deletions
11
1/euler001.bash
Executable file
11
1/euler001.bash
Executable file
|
@ -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"
|
Reference in a new issue