#!/usr/bin/perl -w
$first=4055;
$last=5332;
$max=2200;
$n=20;
%p=();
for $start (0..$first) {
    for $len (($last-$start+1)..$max) {
	my $prob=$len**-$n;
	$p{$len}+=$prob;
    }
}
my $total=0;
map {$total+=$_} values %p;
map {$p{$_}/=$total; } keys %p;
my $cum=0;
for (sort {$a<=>$b} keys %p) {
    $cum+=$p{$_};
    print "$_\t$cum\n";
}
