I am trying to create a perl program that will find all of the prime numbers between 1 and 10. does anyone know of an equation that can be used with perl in order to get that. or am i looking at this all wrong.
Thanks
Funny Or Not: The Microsoft Band in Jokes & Funny Stuff 


raid0 recovery in Hardware Hangout 


Dad Posts Meddling Note Sent Home by Teacher over Packed Lunch in Real World News 


How is Windows 10 on tablet? in Microsoft Beta 


Comcast apologizes for changing customer's billing name to profanity in Real World News 

Posted 28 January 2008  16:49
Posted 28 January 2008  20:07
Edited by rpgfan, 28 January 2008  20:14.
Posted 29 January 2008  12:58
Posted 29 January 2008  13:43
Correct. More info on that technique: http://mathforum.org....prime.num.htmlThere's no formula to generate all the primes. Either look at each number in turn and check if it's divisible by any of the (prime) numbers smaller than (the square root of) it, or start with an array of all the numbers then strike out all the multiples of 2, then all the multiples of 3, then 5 etc
Posted 29 January 2008  19:09
#! use strict; my @list = 1..100; foreach $a (@list){ my@total=(); foreach $b(@list){ if ((int($a/$b)==($a/$b))){ push @total, $b; } } print "$a is prime\n" if($#total == 1); }