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;}
Edited by Duh Puck, 15 February 2008 - 06:51 PM.
![]() |
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 :-) |
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?
Posted 15 February 2008 - 06:50 PM
Edited by Duh Puck, 15 February 2008 - 06:51 PM.
Posted 09 March 2008 - 02:39 AM
I think you should include dividing 11 to get a remainder of 10 and dividing 12 to get a remainder of 11I 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?
Posted 17 March 2008 - 11:55 PM
wrote a simple script - the smallest number is 2519.
here is my way.
$solution = "F";
$x=0;
while($solution eq "F")
{
$x++;
$flag=0;
for($i=1;$i<10;$i++)
{
$j=$i+1;
$y=$x%$j;
if($y != $i)
{$flag=1;}
}
if($flag==0)
{
$solution="T";
print $x,"\n";
}
}
## it is perl.
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;}
Posted 18 March 2008 - 04:05 PM
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?
Posted 18 March 2008 - 06:05 PM
New solutionNope ... 2521 is not divisible by 11.
Edited by imran, 18 March 2008 - 06:06 PM.
Posted 18 March 2008 - 06:46 PM
New solution
Spoiler for 2nd tryThe number is 25201.
My solution is that the number should be X=2520Y+1 and for some integer Y X should be divisible by 11. Is there some simpler method?
0 members, 0 guests, 0 anonymous users
Community Forum Software by IP.Board 3.4.4
Licensed to: BrainDen
