#Bash + coreutils, 30
Bash + coreutils, 30
seq $1|factor|egrep -c :.\\S+$
#Bash + coreutils + BSD-games package, 22
Bash + coreutils + BSD-games package, 22
primes 1 $[$1+1]|wc -l
This shorter answer requires that you have the bsdgames package installed: sudo apt install bsdgames
.