wu :: forums
« wu :: forums - The anguish of a student in love (a math student) »

Welcome, Guest. Please Login or Register.
Nov 24th, 2024, 5:51pm

RIDDLES SITE WRITE MATH! Home Home Help Help Search Search Members Members Login Login Register Register
   wu :: forums
   riddles
   medium
(Moderators: ThudnBlunder, Icarus, william wu, towr, SMQ, Eigenray, Grimbal)
   The anguish of a student in love (a math student)
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: The anguish of a student in love (a math student)  (Read 1327 times)
MitkoS
Newbie
*





   


Posts: 3
The anguish of a student in love (a math student)  
« on: Mar 30th, 2010, 11:44pm »
Quote Quote Modify Modify

A math student fell in love in the beautiful and rich princess of the local realm. But her father (the king) was rigid and slightly evil. He hated his accountants because they lied to him a little bit. He hated also the software engineers because his computer systems regularly go down. He had a kind of phobia of these people.  
The princess had just grown up enough to start looking for partners. The king had just announce the news that in three days there will be an exam for a spouse candidates of his daughter and the exam was to be in math.  
Our student was firstly happy but then he started wondering if he had to go because the king, tortured by his phobia, had defined the following criteria:  
 
- The number N between 8000 and 9999 will be given;  
- The last NON-zero digit of the number N! (factorial of N) should be found  
- The candidates can use only a pencil and sheets of paper, no electronic calculators, no laptops
- An hour will be given for solving and calculating  
- The one who is not able to calculate correct the digit, will be hanged  
- The one who answers correctly first, wins the princess and the realm  
 
Our student had three days to decide whether to go to the exam or not.  
Do you think he will go? … He is a famous excellent grader, but will this help him in his decision to go there?  
 
--------------
NOTES
1. Clarification:
8! = 8 x 7 x 6 x 5 x 4 x 3 x 2 x 1 = 40320
The "last NON-zero digit" of 40320 is 2
2. My English is not perfect, but I hope, the text in this riddle is understandable
« Last Edit: Mar 30th, 2010, 11:48pm by MitkoS » IP Logged
towr
wu::riddles Moderator
Uberpuzzler
*****



Some people are average, some are just mean.

   


Gender: male
Posts: 13730
Re: The anguish of a student in love (a math stude  
« Reply #1 on: Mar 31st, 2010, 2:37am »
Quote Quote Modify Modify

The simplest approach I've found is the one given in the description of sequence A008904 in the on-line encyclopedia of integer sequences: write n in base 5, then multiply di!*2i*d_i modulo 10 (where di is the ith digit from the back counting from 0), finally multiply by 6 and take the last digit.
For example, n = 957610 = 3013015, gives (1!*20*1) * (0!*21*0) * (3!*22*3) * (1!*23*1) * (0!*24*0) * (3!*25*3) * 6 = 6 (mod 10)
« Last Edit: Mar 31st, 2010, 2:40am by towr » IP Logged

Wikipedia, Google, Mathworld, Integer sequence DB
MitkoS
Newbie
*





   


Posts: 3
Re: The anguish of a student in love (a math stude  
« Reply #2 on: Apr 16th, 2010, 11:14pm »
Quote Quote Modify Modify

It was my first post in Wu :: forums, I was so excited, so I forgot to tell that the evil king stopped the electricity in the kingdom immediatelly after he announced the news for the exam.  Grin
 
And you have three days to prepare yourself for the exam without any Internet access. Of course, if you know in advance some facts concerning this matter, you can take a pencil and sheets of paper and prove these facts to yourself. But if you don't know anything in advance, you have three days to find some method to pass the exam with the same conditions: no Internet access, only pencil and sheets of paper. Your target is to prove yourself that the method you will use in the exam is absolutelly correct and you will not be hanged
IP Logged
MitkoS
Newbie
*





   


Posts: 3
Re: The anguish of a student in love (a math stude  
« Reply #3 on: Apr 27th, 2010, 2:49pm »
Quote Quote Modify Modify

This riddle was published simultaneously in a local math forum and in a local folum for logic and fun at 08-Jan-2010. The next evening (09-Jan-2010) the  author posted in these forums he has made a wrong conclusions and he doesn't has a solution for this riddle. And he will be hanged if he doesn't find a solution for the next two days.
But the next evening (10-Jan-2010) a correct mathematical solution was found and developed in the local logic forum. (It was a teamwork - the author and his friend.)
In the local math forum, this riddle was unsolved.
IP Logged
nakli
Junior Member
**






   
WWW Email

Gender: male
Posts: 62
Re: The anguish of a student in love (a math stude  
« Reply #4 on: Jul 21st, 2010, 7:09am »
Quote Quote Modify Modify

The first trick to use when N is very large is to group up numbers
with the same last digits.  Eg for 1000000!, after dividing out all of
the 5s from 1000000!, you get the product of all numbers NOT divisible
by 5 up to 1000000, times the product of all numbers NOT divisible by
5 up to 200000, times the product of all numbers NOT divisible by 5 up
to 40000, and so on to 8000, 1600, 320, 64, 12, and 2 (for the same
reason that the number of 5s in 1000000! is 200000 + 40000 + 8000 +
1600 + 320 + 64 + 12 + 2).  But the last 3 digits of the product of
all of the numbers from 1 to 999 not divisible by 5 is the same as the
last three digits of the product of all of the numbers from 1001 to
1999 not divisible by 5, and so on.  Figure out what this number is,
and then you can do blocks of 1000 numbers at once.  If this number is
M, then you get
 
  M^1000 * M^200 * M^40 * M^8 * M = M^1249
 
times the smaller products (up to 600, 320, 64, 12, and 2) which
require less work.  Of course, computing the last 3 digits of M^1249
can be done quickly with modular exponentiation.
 
Actually, you should do all of this mod 5^3 (rather than 10^3), so
that you can also divide by 2^249998 mod 5^3.  Then, since the number
of 2s in 1000000! is a lot more than 3 more than the number of 5s, you
can divide by 2^3 mod 5^3, and then multiply the result by 2^3 mod
10^3 to get the last three digits of 1000000!/10^249998.
 
 
More methods at :  
http://www.research.att.com/~njas/sequences/A008904
http://www.mathpages.com/home/kmath489.htm
IP Logged

I was born naked on a bed with a lady.
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »

Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board