Find a non-empty set of positive integers, base 10, no two equal, such that:
(1) For any number N in the set, none of the numbers in the set has N digits.
(2) For any number N in the set, the sum of the squares of the digits of N is also in the set.
(3) The number of numbers in the set is also in the set.
(4) The largest number in the set is equal to the sum of all of the other numbers in the set.
Among all such sets find one with the fewest numbers, and among those,
find the one with the smallest largest number.
Originally posted by MathurineI think I found a set which satisfies all but (4):
[b]Find a non-empty set of positive integers, base 10, no two equal, such that:
(1) For any number N in the set, none of the numbers in the set has N digits.
(2) For any number N in the set, the sum of the squares of the digits of N is also in the set.
(3) The number of numbers in the set is also in the set.
(4) The largest number in the set is equa ...[text shortened]... e with the fewest numbers, and among those,
find the one with the smallest largest number.[/b]
(4, 14, 16, 17, 20, 25, 29, 37, 42, 50, 58, 85, 89, 145)
I believe any set which satisfies (4) must be larger than this.
Originally posted by idiomsAny details on how you approached the problem? I tried a few different ways but got lost every time.
{4,16,20,24,37,40,42,58,61,73,77,89,98,106,145,890}
one of these numbers is kinda different, one of these numbers is not the same 😉
i believe this is the smallest size set and top number that satisfies the criteria.
Originally posted by XanthosNZThis isn't going to be especially clear i'm afraid. It's hard to explain without mathematical notation
Any details on how you approached the problem? I tried a few different ways but got lost every time.
I knew the seed set i was looking for was self contained for not simply one iteration of the sum of squares algorithm but infinite iterations
I then wrote a perl program to sort all numbers of 4 digits or less into groups based on the number iterations it took for the sum of squares algorithm to produce a bound set.
I wrote another perl program to check each set. The numbers in the set i wanted (call it S) all had their sum of squares in the set as well. There was only one such set which had an iterative length of 8
{16,37,58,89,145,42,20,4}
So that was my seed set .. the next bit stumped me for a while. I knew it would be set size of 16 as this was the only reasonable length given that i had to stay under 1000 for the top number. I could also add as many permutations of the seed set including adding zero to fill up the set, no matter how i did it though i couldn't make it add up to a number in the original set S. Then i realized i can use a number not in S as long as the sum of its square was in S and that solved it
I'm not 100% sure that 890 is the lowest number .. it could be that by carefully selecting numbers from other sets you can create a lower number but 16 is definitely minimum set size.
I started like this following the 2nd rule:
5..
25 //we need the square of 5 in the set of numbers..
29 //2*2+5*5
85 //2*2+9*9
89 //64+25
145 //64+81
42..
20..
4..
16..
37..
58 //and i stopped because i allready have 89 in the list.
the total sum is 555.. but it's no good because i would need 5*5+5*5+5*5 which is 75. And I don't have 75 in my list.
I started looking for a numer that would have the sum of square digits in the set above and added to 555 would lead to a number that has the sum of its square digits in the set.
And quickly found 52. The sum will be 607 which has the sum 36+49=85.
So the entire set is:
4,5,16,20,25,29,37,42,52,58,85,89,145,607.
LE: sorry.. i skipped one rule.. i don't have 14 in the set which is the number of integers. I will try to find a solution.
LE2: ok.. I found on my way home the last 2 numbers: 102, 21. With them the sum becomes 730, and the number of number will be 16.
Final result:
4,5,16,20,21,25,29,37,42,52,58,85,89,102,145,730.
So.. I think I found the ultimate solution.
I started by the same algorithm as described before to see where does every number from 4 to 15 lead to.. it's no sense trying numbers greater than this, because the minimum set until this point had 16 numbers.
For 4 we have the most efficient set that solves rule nb 2.
4,16,37,58,89,145,42,20;
So the minimum set lenght could be 9.
But it ain't because adding 9 breaks rule nb2
10 needs 1 because of rule nb2, so it breaks rule nb 1;
11 needs 2 but the sum isn't ok..
12 leads to 5 and that leads to the solution above.
13 leads to 10. No good.
14 needs 17,50,25,29,85 and the main set so it doesn't meet with rule nb4
15 needs 26,40 and the set above.
So we have 15,26,40,4,16,37,58,89,145,42,20; And we need 4 more nb. We have the partial sum 492. Posible canditates at a quick glance: 98,24,2,61,73,85,51,62. After a dozen tries i come up with 2,24 and 62 as the lucky nbs. The total sum is 580 which is the last number.
Final result:
2,4,15,16,20,24,26,37,40,42,58,62,89,145,580
Originally posted by altfellcan't use 2
So.. I think I found the ultimate solution.
I started by the same algorithm as described before to see where does every number from 4 to 15 lead to.. it's no sense trying numbers greater than this, because the minimum set until this point had 16 numbers.
For 4 we have the most efficient set that solves rule nb 2.
4,16,37,58,89,145,42,20;
So the minim ...[text shortened]... 580 which is the last number.
Final result:
2,4,15,16,20,24,26,37,40,42,58,62,89,145,580
Originally posted by idiomsI think this is the set with smallest high number
This isn't going to be especially clear i'm afraid. It's hard to explain without mathematical notation
I knew the seed set i was looking for was self contained for not simply one iteration of the sum of squares algorithm but infinite iterations
I then wrote a perl program to sort all numbers of 4 digits or less into groups based on the number iterations umbers from other sets you can create a lower number but 16 is definitely minimum set size.
{16,37,58,89,145,42,20,4,24,26,29,38,40,76,59,703}
ED: maybe not .. you can actually use any number that produces a number in the seed set in less that 8 iterations of the sum of squares function .. so it is potentially possible to create a set with less than 16 members