Calculate sum of first n natural numbers in java July 8, 2019 16 32 64 128 Sum of first n natural numbers How to calculate sum of digits in java