I just started using Mathematica and at the moment I'm learning some things.
As you can see in the headline, I want to make a list of numbers (up to 100) whose digit sum is greater or equal 5.
I started with
Select[Total[IntegerDigits[Range[100]], {2}], GreaterThan[4]]
that leads to the following list:
{5, 6, 7, 8, 9, 5, 6, 7, 8, 9, 10, 5, 6, 7, 8, 9, 10, 11, 5, 6, 7, 8, \
9, 10, 11, 12, 5, 6, 7, 8, 9, 10, 11, 12, 13, 5, 6, 7, 8, 9, 10, 11, \
12, 13, 14, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 8, 9, 10, 11, 12, \
13, 14, 15, 16, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 9, 10, 11, 12, \
13, 14, 15, 16, 17, 18}
So now I have the list of all digit sums meeting my requirement. But how do I use it to list up the numbers which belong to them? I wanted to use it to overwrite the "wrong" numbers with a "nothing". Or am I using a much too difficult way?
Thank you in advance! I hope my English is good enough to at least understand what I want to do
Select[Range[100], Total@IntegerDigits@# > 4 &]
$\endgroup$x /. FindInstance[Mod[x, 10] + Quotient[x, 10] >= 5 && 0 <= x < 100, x, Integers, 100]
$\endgroup$