Is this the answer?
1053-764=289
Perhaps that the digits in the 4-digit number add up to form a number divisible by 9.
For example, if you get 1089, you know it's divisible by 9 because 1+0+8+9 = 18 and 18 is divisible by 9.
Since you have 1 and 0, the last numbers can be 8 and 9, or 6 and 2, or 5 and 3
Sut since 2 was already used you are left with 8 and 9 or 5 and 3
1053-789=264
That's the smallest I can find, so far.
By reasoning, we can say the first 2 digits of the 4-digit number are 10
and the first digit of the 3 digit number is 7.
The first digit of the result is 2.
20X, 21X are not solutions, neither is 22X.
23X falls short because we must take 9 from 12 or 8 from 11.
This could involve 8+carry from 12, 7+carry from 11.
The remaining digits in the units positions will not combine.
You can reason that way for 24X and 25X also, ending up at 26X which pulls through.
Yikes! I missed the 24X..... here you go, eumyang
Obviously not viable during competition, but easy brute force gives 246.
Java:
Output:Code:public class DistinctDigSubtrQ { public static void main(String[] args) { int i,j; long t=time(); String s; for(i=201;i<299;i++) if(hasDistinctDigs(s=str(i))) for(j=1034-i;j<988;j++) if(hasDistinctDigs(str(i+j)+str(j)+s)) { System.out.println((i+j)+"-"+j+"="+i); System.out.println("Elapsed: "+(time()-t)/1000.0+" s"); return; } } static boolean hasDistinctDigs(String s) { boolean[] digs=new boolean[10]; int i,d; for(i=0;i<s.length();i++) { d=Integer.parseInt(s.substring(i,i+1)); if(digs[d]) return false; else digs[d]=true; } return true; } static String str(int n) { return Integer.toString(n); } static long time() { return System.currentTimeMillis(); } }
Code:1035-789=246 Elapsed: 0.04 s
Question 29
I have a list of thirty numbers where the first number is 1, the last number is 30 and each of the other numbers is on more than the average of its two neighbours. what is the largest number in the list
Question 30 (I couldn't be stuffed reading this, didn't have time anyway)
There are so many towns on the island of Tetra, all connected by roads. Reach town has three roads leading to three other different towns: one red road, one yellow road and one blue road, where no two roads meet other than at towns. If you start from any town and travel along red and yellow roads alternately (RYRY...) you will get back to your starting town after having travelled over six different roads. In fact RYRYRY will always get you back to where you started. In the same way, going along yellow and blue roads alternately will always get you back to the starting point after travelling along six different roads (YBYBYB). On the other hand, going along red and blue roads alternately will always get you back to the starting point after travelling along four different roads (RBRB). How many towns are there on Tetra?
I think I got it. I noticed that as I put numbers into the sequence the difference between successive terms must decrease by 2 in order for the criterion to hold (each successive number is 1 more than the average of its 2 neighbors).
I also noticed that after I get to a high point the numbers repeat themselves backwards, going back to 1. Seeing that the last number of this sequence is 30, I guessed that 30 was also the 2nd number.
$\displaystyle 1, 30, ...$
1 + 29 = 30, so the next number has to be 30 + 27 = 57.
$\displaystyle 1, 30, 57, ...$
57 works, because 30 is one more than the average of 1 and 57. The next number is 57 + 25 = 82.
$\displaystyle 1, 30, 57, 82, ...$
And 57 is one more than the average of 30 and 82. You continue the pattern (adding 23 to 82, then adding 21, then adding 19,...), and after you add 1, you start subtracting 1, then subtracting 3, then subtracting 5, etc.
Here is the complete sequence:
$\displaystyle 1, 30, 57, 82, 105,$
$\displaystyle 126, 145, 162, 177, 190,$
$\displaystyle 201, 210, 217, 222, 225,$
$\displaystyle 226, 225, 222, 217, 210,$
$\displaystyle 201, 190, 177, 162, 145,$
$\displaystyle 126, 105, 82, 57, 30$
So the largest number is 226. I used the OpenOffice.org Calc spreadsheet again to figure this out, of course.
I got number 30 too. I started with drawing hexagons... then got completely lost when I came to the last statement about the RBRB... I was thinking about a football, where hexagons were arranged together with pentagons, but this didn't fit the problem since following this logic, we would get hexagons and squares.
My number 29 was a different though.
I'm trying to do 30 but, it doesn't seem to stop? :O
EDIT: I think it's 24?
Hexagon in the middle BYBYBY
Centre is connected to 3 hexagons and 3 squares.
The outer hexagons make 3 squares which those 3 squares connect together and make the whole island as all towns have 3 roads.