You can run this with or without a numeric argument. I wouldn't recommend numeric arguments past 15; it becomes pretty processor bound.
$p=Math::BigFloat;$n=$ARGV[0]||10;$p->accuracy(400);$w=do{$w=$p->new; $w+=1/$p->new($_)->bfac for 0..125;$w->bstr};for(0..length($w)-$n){$z =substr$w,$_,$n;use Math::BigFloat;if(ip($z)){print"$z \@ $_$/";last} }sub ip{($y)=@_;($s,$d)=(sqrt$y,2);{return if$y%$d==0;last if$d++>$s; redo}1}
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: A natural occurrence
by japhy (Canon) on Mar 01, 2006 at 20:35 UTC | |
by davido (Cardinal) on Mar 01, 2006 at 20:41 UTC | |
by jdalbec (Deacon) on Mar 04, 2006 at 16:03 UTC | |
by japhy (Canon) on Mar 04, 2006 at 21:57 UTC | |
|
Re: A natural occurrence
by stubblyhead (Initiate) on Mar 03, 2006 at 22:49 UTC | |
|
Re: A natural occurrence
by benizi (Hermit) on Mar 03, 2006 at 16:49 UTC |