I thought only about exhaustively trying all nine-digit numbers starting at 987564321. It may not be the most efficient but at least it kept me too busy to post anything today!
I started with 102345678 and the first multiple of 11 I came to was 102345683, so I used a spreadsheet to count up in 11s from there and then started eliminating sets of last few digits
You can prove that 123475869 is divisible by 11 by checking the alternate sum is divisible by 11, so 1-2+3-4+7-5+8-6+9. I wonder could that be worked in reverse in some way.
Yes, that's the sort of divisibility test I was looking for. I know the obvious ones like testing for divisibility by 3 or 9 but I wasn't sure what the rule would be for 11 so that's interesting, Nick
I can't actually remember, Prudie, to be hones, I'll have to check myself. I only remember it as a guide for big numbers. I might even be confusing it with something else, that does happen these days, but it seemed to work with the ones I tried.
It might even be a case of that method proves the number is divisible by 11, but doesn't say that a number that doesn't do that isn't, which would be naff all use in this case!
I have been doing maths refreshers lately thanks to Numberphile, but I have a long way to go yet:)
ok doing what programmers do when their maths skills run out I wrote a simple program to do it by brute force, the answer is 123475869, assuming no zero is allowed. For those that can stand the excitement here is my code, It's in an IBM mainframe language called REXX.
https://ibb.co/m9mr1xG
Thanks TTT. For the 'no zero' solution I started with 123456789 then counted on until I found the first number after that divisible by 11, which was 123456795.
I then used Excel to count on in 11s to list the next few thousand multiples of 11.
I then worked my way down and deleted big blocks by eliminating those where the last 3 digits contained anything other than a combination of 789.
Then when I'd eliminated all those I looked at those starting 12345 and deleted all those with anything other than combinations of 6, 7, 8 and 9.
Then I looked at those starting with 12346 and eliminated everything by inspection as there were none ending in combinations of 5,7,8,9.
So then I did those starting with 12347 and looked for the first item ending in a combination of 5,6,8,9. That brought me to 123475869
So a combination of narrowing it down logically plus brute force and inspection.
Yes, I tend to use only the more basic Excel functions now. It took me maybe 20-30 minutes to eliminate the nonqualifying numbers by inspection and then go back and double check I hadn't missed a solution, but it probably would have taken me a lot longer to remember how to write the necessary program.
Many many years ago I used to do these things by writing a programme in Basic on my Commodore 64 but I used to have to leave it running overnight
Sorry, we can't find any related questions. Try using the search bar at the top of the page to search for some keywords, or choose a topic and submit your own question.