For each positive integer n , let s ( n ) denote the sum of the digits of n . We call a number nifty if it can be expressed as n − s ( n ) for some positive integer n .
How many positive integers less than 10 000 are nifty?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Nice solution. Do you think you could help us with finding a rule for multiples of 9 which cannot be written in this form?
EDIT: Your solution gives a method of doing so! Great!
Log in to reply
Try 1 1 1 a + 1 1 b + c = 1 1 2 a + 1 1 ( b − a ) + ( c + a ) Counting in base 1 1 , the numbers you cannot get are basically those with a ≡ 1 0 , b ≡ a − 1 or c ≡ − a − 1 modulo 1 1 .
Log in to reply
Can we generalise this to a 1 + 1 1 a 2 + 1 1 1 a 3 + … + 1 1 1 . . . 1 1 1 a n ?
Let the no be 10x+y Then a nighty must be tight Means a nifty must be divisible by 9 So nifty =9990=(n-1)*10 N=1000 So there are 1000 tight nighties or nifties
Let f ( n ) = n − s ( n ) . Observe that
f ( 1 0 m ) = f ( 1 0 m + 1 ) = f ( 1 0 m + 2 ) = f ( 1 0 m + 3 ) = … = f ( 1 0 m + 9 )
for all positive integers m . From this, we get all nifty numbers belong in the sequence f ( 1 0 ) , f ( 2 0 ) , f ( 3 0 ) , … .
Also note f ( 1 0 m ) < f ( 1 0 m + 1 0 ) for all positive integers m . This statement is equivalent to
1 0 m − s ( 1 0 m ) < 1 0 m + 1 0 − s ( 1 0 m + 1 0 ) ⟺ s ( m + 1 ) − s ( m ) < 1 0
where we used the fact s ( 1 0 m ) = s ( m ) . The inequality sign s ( m + 1 ) − s ( m ) < 1 0 is trivially true for m ≡ 9 ( m o d 1 0 ) , since m + 1 and m only differ in their last digit. To see that s ( m + 1 ) − s ( m ) < 1 0 if m ≡ 9 ( m o d 1 0 ) , suppose m ends in k 9s. Then the last k digits of m + 1 are 0's, while the preceding digit has increased by 1. Thus, s ( m + 1 ) − s ( m ) = 1 − 9 k < 1 0 .
Since f ( 1 0 0 0 0 ) = 9 9 9 9 and f ( 1 0 0 1 0 ) = 1 0 0 0 8 , it follows that the nifty positive integers less than 10000 are precisely the following.
f ( 1 0 ) < f ( 2 0 ) < f ( 3 0 ) < … < f ( 1 0 0 0 0 )
Therefore, there are 1 0 0 0 nifty positive integers less than 10000.
Ah interesting. Even though "multiple of 9" is a necessary condition, it is not a sufficient condition. For example, 90 isn't a nifty number.
I wonder if we can easily classify all multiples of 9 that are not nifty.
Log in to reply
Some multiples of 9 that aren't nifty (from observation):
90, 189, 288, 387, 486, 585, 684, 783, 882, 981,
990, 1089, 1188, 1287, 1386, 1485, 1584, 1683, 1782, 1881,
1980
1989, 2088, 2187, 2286, 2385, 2484, 2583, 2682, 2781
There seems to be addition of 99 to get to the next number, but this sequence breaks down. Seems interesting. I'll see what I can do here.
Log in to reply
OK, I got all non-nifty multiples of 9 under 10000:
90, 189, 288, 387, 486, 585, 684, 783, 882, 981,
990, 1089, 1188, 1287, 1386, 1485, 1584, 1683, 1782, 1881,
1980, 1989, 2088, 2187, 2286, 2385, 2484, 2583, 2682, 2781,
2880, 2979, 2988, 3087, 3186, 3285, 3384, 3483, 3582, 3681,
3780, 3879, 3978, 3987, 4086, 4185, 4284, 4383, 4482, 4581,
4680, 4779, 4878, 4977, 4986, 5085, 5184, 5283, 5382, 5481,
5580, 5679, 5778, 5877, 5976, 5985, 6084, 6183, 6282, 6381,
6480, 6579, 6678, 6777, 6876, 6975, 6984, 7083, 7182, 7281,
7380, 7479, 7578, 7677, 7776, 7875, 7974, 7983, 8082, 8181,
8280, 8379, 8478, 8577, 8676, 8775, 8874, 8973, 8982, 9081,
9180, 9279, 9378, 9477, 9576, 9675, 9774, 9873, 9972, 9981,
9990
This isn't an OEIS sequence either.
Log in to reply
@Sharky Kesa – You should submit it as a sequence on OEIS!
I don't quite see a pattern other than it's explicit description. Interesting, will have a think about this.
Log in to reply
@Calvin Lin – A282473 has been submitted to OEIS pending review. :)
Problem Loading...
Note Loading...
Set Loading...
With the exception of 9 9 9 9 = 1 0 0 0 0 − s ( 1 0 0 0 0 ) , any positive integer m which is a nifty number can be written as n − s ( n ) where n is at most a 4 -digit number. If n = a b c d is an at most 4 -digit number, then n − s ( n ) = 9 9 9 a + 9 9 b + 9 c = 9 ( 1 1 1 a + 1 1 b + c ) . The value of d does not matter, so we might as well choose d = 1 , so that n is always a positive integer, for any values of 0 ≤ a , b , c ≤ 9 .
Now the map ( a , b , c ) ↦ 1 1 1 a + 1 1 b + c a , b , c = 0 , 1 , 2 , … 9 is injective, and hence there are 1 0 3 = 1 0 0 0 numbers of the form 9 9 9 a + 9 9 b + 9 c = n − s ( n ) for a positive integer n < 1 0 0 0 0 . We need to exclude the case a = b = c = 0 , since this gives the nifty number 0 , which is not positive. On the other hand, we need to include the nifty number 9 9 9 9 in our count. Thus there are 1 0 0 0 nifty positive integers less than 1 0 0 0 0 .