% % Written by: % -- % John L. Weatherwax 2009-04-21 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- addpath('../../BookCode'); close all; clc; clear; % EPage 137 primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173 ]; lhs = cumprod( 1 + 1./primes ); x = primes(2:end); y = lhs(1:(end-1)); % Fit the function y ~ C_0 + C_1 log( x ) % c = fgenfit( 'c_7_p_8_fn', x, y ) plot( x, y, '.', 'MarkerSize', 18 ); hold('on'); plot( x, c(1) + c(2) * log(x), '-g' ); xlabel('prime value'); ylabel('prod_{p < P} ( 1 + 1/p )'); legend( 'data', 'model fit', 'location', 'best' ); %saveas( gcf, '../../WriteUp/Graphics/Chapter7/c_7_p_8_plot.eps', 'epsc' );