Share this post

Link to post

Share on other sites

Guest

Guest

As you say 59 and 119 looked promising, both working upto and including 6, but 7 was the dificulty, so I tried each increment of 60 (179, 239, 299 ...), until I got to 419, which worked for 7 as well, (hooray) but not 9 or 10 (boo). Then using the same logic as before (59 being the first number that worked up the number 6, Increments of 60 always worked for the first 6 numbers. So 419 being the first that works for numbers up to 7 I incremented by 420.) So 419, 839, 1259, 1679, 2099, 2519.

Not a very elogant solution, but it passed a little time.

I assume, some mathemarical genius is going to post an easier way

Just because your voice reaches halfway around the world doesn't mean you are wiser than when it reached only to the end of the bar

Share this post

Link to post

Share on other sites

0

Guest

Guest

If we're looking for n where n divided by x (x being each number 2-10) leaves a remainder of x-1, n+1 divided by each number 2-10 leaves no remainder. To find n+1, we must simply multiply all prime factors of 2-10, excluding any duplicates. This is equal to 2*2*2*3*3*5*7 = 2520, then just subtract one to get the answer of 2519.

When I looked for a smaller number with this property I couldn't find one.

Can you find it?

Let X be the number. From the above properties of X, one can see that,

"X+1" is a multiple of the numbers from 2 to 10. As Bonanova is asking for the smallest number with such properties, "X+1" must be the LCM (least common multiple) of the numbers from 2 to 10 -- which is 2520.

Share this post

Link to post

Share on other sites

Guest

Guest

This problem is simple. All you have to do is find the least common multiple of 2,3,4,5,6,7,8,9, and,10. Then you subtract 1 from that number so that it is not divisible by anyone of those numbers. the number is 2519

Share on other sites

Guest

Guest

After reading the Wikipedia entry and looking at those samples, I'd have to agree that it looks really cool, and totally impractical for any of the work I do. I like the poem at the bottom of the page:

'Tis the dream of each programmer

Before his life is done,

To write three lines of APL

And make the damn thing run.

Perhaps I can make some time on the weekends to learn an arcane, remarkably dense language that I'll never use in real life for the purpose of solving math problems with less code. That I say this in all seriousness is probably a rather sad commentary on my social life.

In the spirit of ATL, I present to you my method, in C#, for calculating the answer by brute force, without taking into account LCM's. I'm curious how much smaller this could be done.

int GetNumber() {

int i=1, n=1; bool r=false;

for (;!r;){if(i%n==(n-1)){n=n%11+1;r=n==11;}else{i++;n=1;}}return i;}

Well, that is shorter code than mine would be, but mine would be done sooner. I don't feel like writing it, but I could do it! I am actually kinda disappointed in myself for not realizing it was a LCM problem... when I was thinking about it in my head, I was considering each sentence seperately and finding a rule for each one. First there was no even numbers allowed (2:1), then the last digit had to be a 9 (10:9), then the second to last digit had to be one less than 3, 6, or 9 (3:2), etc. I came up with 5039 this way... (5039+1)/2 - 1 = 2519, go figure