import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines import numpy as np N,p = read().split() N = int(N); p = float(p) div_cnt = np.zeros(N+1,np.int32) for x in range(1,int(N**.5)+10): if x * x > N: break div_cnt[x*x] += 1 div_cnt[x*(x+1):N+1:x] += 2 div_cnt -= 2 counter = np.bincount(div_cnt[2:]) answer = sum(p ** i * x for i,x in enumerate(counter)) print(answer)