// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
public class WordFrequency {
    public static void main(String[] args) {
        double sum = 0;
        for(int i = 1; i <= 100000; i++) {
            sum += 1.0/i;
        }
        System.out.println(sum);
        for(int i = 1; i <= 20; i++) {
            System.out.printf("%.3f\n", 1/(sum*i));
        }
    }
}
