N,L = map(int,input().split()) INFTY = L//(N-1) P = list(range(INFTY+1)) for i in range(2,INFTY+1): if i*i>INFTY:break for j in range(i*i,INFTY+1,i): P[j] = P[i] Q = [] for i in range(2,INFTY+1): if P[i]==i: Q.append(i) ans = 0 for d in Q: ans += L+1-d*(N-1) print(ans)