This repository has been archived on 2024-01-26. You can view files and clone it, but cannot push or open issues or pull requests.
project-euler/e0001/euler0001.bash

12 lines
211 B
Bash
Raw Permalink Normal View History

#!/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"