05AB1E, 5 bytes
LDp*OŸDp*O
LŸ Push the list [1[a,...,input] b]
D Push a duplicate of that list
p Replace primes with 1 and everything else with 0
* Element-wise multiply the two lists [1*0, 2*1, 3*1, 4*0, ...]
O Sum of the final list of primes
05AB1E, 5 bytes
LDp*O
L Push the list [1,...,input]
D Push a duplicate of that list
p Replace primes with 1 and everything else with 0
* Element-wise multiply the two lists [1*0, 2*1, 3*1, 4*0, ...]
O Sum of the final list of primes
05AB1E, 5 bytes
ŸDp*O
Ÿ Push the list [a,..., b]
D Push a duplicate of that list
p Replace primes with 1 and everything else with 0
* Element-wise multiply the two lists [1*0, 2*1, 3*1, 4*0, ...]
O Sum of the final list of primes