Here you can see the power of Forth in action.
\ by Michel Jean
variable maxim variable nombre variable diviseur variable total
dup nombre ! 2 16 0 do 2dup / + 2 / loop
nip 1+ maxim ! \ initialize
1 diviseur ! begin diviseur @ 2 + diviseur !
nombre @ diviseur @ mod 0= diviseur @ maxim @ >= or until
diviseur @ maxim @ >= if nombre @ . total @ 1+ total ! then
: prime ( --liste des premiers)
0 total ! 999999 1 do i premier? 2 +loop
cr total @ . ." prime numbers less then 1 000 000" ;
(*) after the original work of Michel Jean Ph.D Enseignant en philosophie