perl -lwe 'for $i ( 1 .. 10 ) { for $j ( 1 , $i .. $i + 3 ) { $v = $i * $j ; $s = 0 ; for ( 1 .. $v ) { $s += log ( $_ ) } $s /= log ( 2 ) ; print "$v $s" } }' | sort -nu
1 | 0 |
2 | 1 |
3 | 2.58496250072116 |
4 | 4.58496250072116 |
5 | 6.90689059560852 |
6 | 9.49185309632968 |
7 | 12.2992080183873 |
8 | 15.2992080183873 |
9 | 18.4691330198296 |
10 | 21.791061114717 |
12 | 28.8354552340754 |
15 | 40.2501404698826 |
16 | 44.2501404698826 |
18 | 52.5075283125753 |
20 | 61.0773839209062 |
24 | 79.0376574191005 |
25 | 83.6815136088752 |
28 | 97.9441957512373 |
30 | 107.709067341973 |
35 | 132.924403629914 |
36 | 138.094328631356 |
40 | 159.159039824179 |
42 | 169.908909251575 |
48 | 202.9495720297 |
49 | 208.564281873815 |
54 | 237.063811080429 |
56 | 248.652525716012 |
63 | 289.995143941724 |
No comments :
Post a Comment