Hi there,
Your problem is here:
while(b<=a){
a
divided by itself will return a remainder of 0. so it will be added to the total as well. This should be a quick fix:
while(b<a){
Additionally, you can do some optimization: you don't need to check up to the actual number. Checking until a/2 will be faster and should suffice.
All the best,
NwN