Jump to content


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
 

Photo
- - - - -

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


  • Please log in to reply
67 replies to this topic

#11 kafka

kafka

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 22 January 2008 - 03:48 PM

:P I'de write a computer program in C# that has 10 ifs and get to the number very quickly, but without the mathematic understanding, and for that I thank you guys :blush:
  • 0

#12 octotus

octotus

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 30 January 2008 - 09:45 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.
  • 0

#13 Sanjurjo

Sanjurjo

    Newbie

  • Members
  • Pip
  • 17 posts

Posted 31 January 2008 - 02:11 AM

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.


That seems to take more knowledge of the working mathematics than the other mathematics solutions provided. Guess it just goes to show that math and logic are very much the same animal.
  • 0

#14 freyr

freyr

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 03 February 2008 - 12:40 AM

Actually any number (2520 * K) - 1 where k is any positive integer has these properties
  • 0

#15 Larry

Larry

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 13 February 2008 - 05:22 AM

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
  • 0

#16 papadawg

papadawg

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 14 February 2008 - 07:21 PM

Can also just use XL VB...took 30 secs...just use "mod" to check the remainder, and see if they add up to 45...

Sub xxxx()

For i = 1 To 100000

Cells(1, 3) = i

If Cells(10, 1) = 45 Then
Exit For
End If

Next i

End Sub
  • 0

#17 bonanova

bonanova

    bonanova

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

Posted 15 February 2008 - 06:09 AM

I'm curious ... any of you programmers ever use APL?
It's interpretive, very useful, and very ancient.
  • 0
The greatest challenge to any thinker is stating the problem in a way that will allow a solution.
- Bertrand Russell

#18 Duh Puck

Duh Puck

    Advanced Member

  • Members
  • PipPipPip
  • 445 posts

Posted 15 February 2008 - 07:55 AM

I'm curious ... any of you programmers ever use APL?
It's interpretive, very useful, and very ancient.


Please, you're really showing your age. :-)

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.
  • 0

#19 Aatif

Aatif

    Junior Member

  • Members
  • PipPip
  • 72 posts

Posted 15 February 2008 - 08:28 AM

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?


No need of a brute force method...
Spoiler for Elegance

  • 0

#20 TwoaDay

TwoaDay

    Senior Member

  • Members
  • PipPipPipPip
  • 870 posts
  • Gender:Male

Posted 15 February 2008 - 02:32 PM

2519
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users