Group Abstract Group Abstract

Message Boards Message Boards

0
|
8.2K Views
|
7 Replies
|
9 Total Likes
View groups...
Share
Share this post:

Find numbers with the same cross sum (sum of digits)?

Posted 7 years ago

Hi Guys! I hope all of you are fine :) Maybe someone can tell me here how can I find, with Wolfram Alpha or Mathematica, numbers they have the same sum of digits? For Example: 9999 = 36, now I need a method (or a search criterion for Wolfram Alpha) to find quickly other numbers with the same cross sum. I hope anyone can help me here. Kind regards and best wishes.

POSTED BY: Nural I.
7 Replies
Posted 7 years ago

Hi Henrik & Daniel! Thank you both very much for your time and for the valuable contributions to my question, i really appreciate that! I wish you both also all the best! I am sure i will need these solutions once upon a time as well, and many others (beginners) like me, e.g to understand better the logic behind the wolfram language, but at moment, the method from @Rapsi works perfect for me, it is simple and fast enough, generates me in few minutes a long list (up to 111111111) with the numbers i need. Nevertheless, thanks again, and have a wonderfull day. Best regards.

POSTED BY: Nural I.

I guess in this context the function IntegerPartitions should at least be mentioned. It could be used here like so:

numberList[n_] := Select[IntegerPartitions[n], Max[#] < 10 &]

and from this calculate the numbers, e.g.:

nl = numberList[12];
FromDigits /@ Flatten[Permutations /@ nl, 1]

I cannot imagine to calculate all those numbers for non small n, because the length of this list goes approximately like 0.50398 E^(0.692161 n), which e.g. for n=36 gives 3.34258*10^10 different numbers. Or am I misunderstanding the question?

POSTED BY: Henrik Schachner
POSTED BY: Daniel Lichtblau
Posted 7 years ago

Hi Raspi, yeah, that's it! I don't know how to thank you. I wish you all the best and God's blessing. Thank you very much! Have a wonderful day. Best regards.

POSTED BY: Nural I.
Posted 7 years ago

Hi Daniel! I want to find numbers (quickly) which have always 36 as cross sum, like 9999 or 131923179. I'm looking for a method that generates me quickly such numbers, or a method which generates me directly a list of numbers which have always 36 as cross sum, like the number 9999 or 131923179. I hope you can help me. Best regards.

POSTED BY: Nural I.
POSTED BY: Raspi Rascal
POSTED BY: Daniel Lichtblau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard