import java.math.BigDecimal;
import java.math.MathContext;
import java.util.ArrayList;

public class Euler779 {

    static ArrayList<Integer> sievePrimes(int n) {
        boolean[] isPrime = new boolean[n + 1];
        for (int i = 2; i <= n; i++)
            isPrime[i] = true;

        for (int i = 2; i * i <= n; i++) {
            if (isPrime[i]) {
                for (int j = i * i; j <= n; j += i) {
                    isPrime[j] = false;
                }
            }
        }

        ArrayList<Integer> primes = new ArrayList<>();
        for (int i = 2; i <= n; i++) {
            if (isPrime[i])
                primes.add(i);
        }
        return primes;
    }

    public static String solve() {
        MathContext mc = new MathContext(50);
        ArrayList<Integer> primes = sievePrimes(2000000);

        BigDecimal prefix = BigDecimal.ONE;
        BigDecimal f1 = BigDecimal.ZERO;
        BigDecimal total = BigDecimal.ZERO;

        for (int pInt : primes) {
            BigDecimal p = new BigDecimal(pInt);
            BigDecimal pm1 = p.subtract(BigDecimal.ONE);

            BigDecimal termF1 = prefix.divide(p.multiply(p).multiply(pm1), mc);
            f1 = f1.add(termF1, mc);

            BigDecimal termTotal = prefix.divide(p.multiply(pm1).multiply(pm1), mc);
            total = total.add(termTotal, mc);

            prefix = prefix.multiply(pm1).divide(p, mc);
        }

        // Output with 12 decimal places
        return String.format(java.util.Locale.US, "%.12f", total);
    }

    public static void main(String[] args) {
        System.out.println(solve());
    }
}
