Which command in Mathematica will give me the sum of the digits of a number in base 10? Thanks.
So you want it to give you something like this:
Yes, exactly. Do you know how that is done?
Is this what you are looking for: http://mathworld.wolfram.com/DigitSum.html ?
I had already found that; nothing happens when I plug that into Mathematica. I entered:
s[3^14, 10] := Plus @@ IntegerDigits[3^14, 10]
and then nothing came out. Is this the correct way to enter it? For this example I was trying to compute the sum of the digits of 314 in base 10. Thanks.
That's because you're attempting to define a "function" and haven't asked Mathematica to do anything with it.
For a quick answer, just copy and paste the right side into an input line and evaluate it.
Separate names with a comma.