A positive integer is called shiny if it can be written as the sum of two not necessarily distinct integers a and b which have the same sum of their digits. For instance, 2012 is shiny, because 2012 = 2005 + 7, and both 2005 and 7 have the same sum of their digits. Find all positive integers which are not shiny (the dark integers).
Let the number being investigated be n.
Let the sum of digits of n be SOD(n)
Let a=(n1)/2
Let b=(n+1)/2
I SOD(a)+SOD(b)=SOD(n)+9r, r in Z
On each of k steps, add 1 to a and deduct 1 from b
II SOD(a+k)+SOD(bk)=SOD(n)+9s, s in Z
Let k=5
Now (a+5)=(b5)+9;
And SOD(a+k)+SOD(bk)=SOD(n) or SOD(n)+/9s (II)
This is necessarily a solution unless:
(i) (b5) is negative (i.e.1,3,5,7); or
(ii) The number of zeroes in (a+5) or (b5) has changed (the converse is not implied) (III)
Next, add 9 to (a+5), and deduct 9 from (b5) .
All other things being equal, there will be no change in the values of SOD(a+14) and SOD(b14), unless the number of zeroes in one of them has changed (IV)
If so, either:
(i) SOD(a+14) = SOD(b14), or
(ii) SOD(a+14) = SOD(a+5), and SOD(b14) = SOD(b5), in which case either:
(ii)(a) SOD(a+23) = SOD(b23), or
(ii)(b) The number of zeroes in SOD(a+23) or SOD(b23) has changed (the converse is not implied).
Obviously this process can be repeated until a solution is found or (b9k5)=0
e.g. 797:
k=0, {(a+5), (b5), SOD(a+5), SOD(b5)} = {403,394, 7,16} (III)
k=1, {(a+5), (b5), SOD(a+14), SOD(b14)}= {412,385,7,16}
k=2, {(a+23), (b23),SOD(a+23), SOD(b23} = {421,376,7,16}
k=3, {(a+32), (b32),SOD(a+32), SOD(b32} = {430,367,7,16} (IV)
k=4, {(a+41), (b41),SOD(a+41), SOD(b41} = {439,358,16,16} (IV(ii)(a))
e.g. 799:
k=0, {(a+5), (b5), SOD(a+5), SOD(b5)} ={404,395,8,17} (III)
...
k=41, {(a+41), (b41), SOD(a+5), SOD(b5)} ={440,359,8,17} (IV)
but:
k=50, {(a+50), (b50), SOD(a+50), SOD(b50)} ={449,350,17,8} (IV(ii)(b))
k=95, {(a+95), (b95), SOD(a+95), SOD(b95)} ={494,305,17,8} (IV)
But:
k=104, {(a+104), (b104), SOD(a+104), SOD(b104)} ={503,296,8,17} (IV(ii)(b))
... And so on down to (a+9k+5)=799, (bk5)=0, with no solutions.
It seems clear enough from the above that with the exception of {1,3,5,7,9} all digits but the first must be a 9, for a number to be 'dark'. Let's assume that the number of 9's is even, e.g. 99, 9999, ... etc., prefixed by no other number;
(98/2+5) = 54, (100/25 = 45)
(9998/2+50) = 5049, (10000/250 = 4950)
(999998/2+500) = 500499, (1000000/2500 = 499500)
Generally, SOD (10^(2n)2)/2+5*10^(n1) = SOD (10^(2n))/25*10^(n1); if the number of 9's is even, then the number is shiny. (V)
Let's assume that the even string of 9's is prefixed by an even integer: e.g. 299 splits into 149 and 150; 100 is much larger than 5, so the addition of the prefix makes no difference.
Edited on June 22, 2013, 7:12 am

Posted by broll
on 20130622 07:10:02 