[ create a new paste ] login | about

Link: http://codepad.org/mcEJ1yKG    [ raw code | output | fork ]

Perl, pasted on Feb 5:
use strict;
use warnings;
use bigint;

my $n = Math::BigInt->new("2");
my $b = Math::BigInt->new("0");
my $baisu = Math::BigInt->new("2");

my @era = ("0") x 775145;
for($n; $n <= 775145; $n++){
	if(!$era[$n]){
		$b = $n * $baisu;
		do{
			$era[$b] = 1;
			$baisu++;
			$b = $n * $baisu;
		}while($b <= 775145);
	}
}

do{
	print (my $length = @era) if(!($n = pop(@era)));
}while($n);


Output:
1
2
3
Useless use of private variable in void context at t.pl line 19.

Timeout


Create a new paste based on this one


Comments: