## Welcome to BrainDen.com - Brain Teasers Forum

 Welcome to BrainDen.com - Brain Teasers Forum. Like most online communities you must register to post in our community, but don't worry this is a simple free process. To be a part of BrainDen Forums you may create a new account or sign in if you already have an account. As a member you could start new topics, reply to others, subscribe to topics/forums to get automatic updates, get your own profile and make new friends. Of course, you can also enjoy our collection of amazing optical illusions and cool math games. If you like our site, you may support us by simply clicking Google "+1" or Facebook "Like" buttons at the top. If you have a website, we would appreciate a little link to BrainDen. Thanks and enjoy the Den :-)
Guest Message by DevFuse

# Help! A remainder is chasing me

Best Answer normdeplume , 19 September 2007 - 07:23 PM

My answer is below, is this the answer you were looking for or is there a lower one?

Spoiler for solution

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. Go to the full post

67 replies to this topic

### #31 autonav

autonav

Junior Member

• Members
• 39 posts

Posted 16 May 2008 - 10:53 PM

Here is my answer to the original puzzle.
Spoiler for solution

• 0

### #32 OstermanA

OstermanA

Newbie

• Members
• 19 posts

Posted 25 May 2008 - 05:22 AM

```#include <cstdlib>
#include <iostream>
using namespace std;
bool mod(unsigned int);
int main() {
unsigned int i;
for( i = 0; !mod(i); ++i);cout << i << endl;
system("PAUSE");
return EXIT_SUCCESS;
}

bool mod(unsigned int i) {
for( unsigned int j = 2; j <= 10; ++j)
if( i % j != (j - 1) )
return false;
return true;
}```

Or, as my dad put it, (5*7*8*9)-1=2519

Damn engineers.

Edited by OstermanA, 25 May 2008 - 05:31 AM.

• 0

### #33 shobith

shobith

Junior Member

• Members
• 21 posts

Posted 05 June 2008 - 07:33 AM

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.

thats right.
we are looking for (lcm of 1 to 10 )-1=2520-1=2519
• 0

### #34 bonanova

bonanova

bonanova

• Moderator
• 5918 posts
• Gender:Male
• Location:New York

Posted 05 June 2008 - 07:52 AM

Here is my answer to the original puzzle.

Spoiler for solution

Spoiler for Almost, but not quite.

• 0
The greatest challenge to any thinker is stating the problem in a way that will allow a solution.
- Bertrand Russell

### #35 palaisipan

palaisipan

Newbie

• Members
• 6 posts

Posted 05 June 2008 - 10:11 AM

Another variation of the above problem is as follows:

I just found a number with an interesting property:

When I divide it by 2, the remainder is 1.
When I divide it by 3, the remainder is 1.
When I divide it by 4, the remainder is 1.
When I divide it by 5, the remainder is 1.
When I divide it by 6, the remainder is 1.
When I divide it by 7, the remainder is 1.
When I divide it by 8, the remainder is 1.
When I divide it by 9, the remainder is 1.
When I divide it by 10, the remainder is 1.

But when I divide it by 11, the remainder is 0 (just to make the procedure a little bit different).

Can you find it?

Spoiler for solution

• 0

### #36 autonav

autonav

Junior Member

• Members
• 39 posts

Posted 10 June 2008 - 07:31 PM

There is another answer, which is -1. For example -1/9 = (-9+8)/9= -1 with remainder 8
• 0

Newbie

• Members
• 8 posts

Posted 12 June 2008 - 06:51 PM

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;}

Using a while statement instead might save a few spaces, but the biggest space saver I would be changing n=n%11+1 to n++. Both increment n by 1 but n++ is much more logical. I don't really understand why you wouldn't use it. I'm sure there are more ways to reduce the code as well.
• 0

### #38 tatu

tatu

Newbie

• Members
• 1 posts

Posted 10 October 2008 - 11:53 PM

check it out
• 0

### #39 sunil

sunil

Newbie

• Members
• 3 posts

Posted 10 November 2008 - 10:33 AM

A number that satisfies all of these properties is:

Spoiler for above problem

I did not get it. 2519 is divisible by 11
• 0

### #40 xucam

xucam

• Members
• 246 posts

Posted 11 November 2008 - 09:36 PM

Since negative numbers are not excluded by the problem as posed, the answer is negative infinity - since any other solution has another number smaller than it. This doesn't fit well with the statement 'it is not a small number', but that is a subjective description.

2519
-1
-2521
-5041
-7561
-10081
-12601
-15121
-17641

etc.

I just found a number with an interesting property:

When I divide it by 2, the remainder is 1.
When I divide it by 3, the remainder is 2.
When I divide it by 4, the remainder is 3.
When I divide it by 5, the remainder is 4.
When I divide it by 6, the remainder is 5.
When I divide it by 7, the remainder is 6.
When I divide it by 8, the remainder is 7.
When I divide it by 9, the remainder is 8.
When I divide it by 10, the remainder is 9.

It's not a small number, but it's not really big, either.
When I looked for a smaller number with this property I couldn't find one.

Can you find it?

Edited by xucam, 11 November 2008 - 09:37 PM.

• 0

#### 0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users