On peut tout faire sous Linux ;-)
-- Arnaud Vandyck
<http://vbstefi60.fapse.ulg.ac.be/~arnaud/>
<http://www.ulg.ac.be/cgi-bin/ph/search?id=u184137>
�O� est pass� Bob?..�
#! /bin/bash
# nbrprm par Arnaud Vandyck (c) 2003 pour STE-Formations Informatiques
# $Id$
# This program prints the 100 first primary numbers (nombres premiers)
MAX=100;
DIVISEUR=4;
NB=3;
echo -n "1 2 3 ";
while (( NB<=MAX ));
do
ISNBRPRM=1;
QUOT=2;
while (( QUOT<DIVISEUR )) && (( ISNBRPRM!=0));
do
ISNBRPRM=$(( $DIVISEUR%$QUOT ));
QUOT=$(( $QUOT+1 ));
done;
if (( ISNBRPRM!=0 ));
then
NB=$(($NB+1));
echo -n "$DIVISEUR ";
fi
DIVISEUR=$(($DIVISEUR+1));
done;
echo "";
exit 0;