Click here to Skip to main content

Algorithms

 
GeneralRe: Factorials PinmemberTim Craig25-Jun-08 9:55 
GeneralRe: Factorials PinmvpLuc Pattyn25-Jun-08 12:01 
GeneralRe: Factorials PinmemberTim Craig25-Jun-08 22:06 
AnswerRe: Factorials Pinmembercp987624-Jun-08 13:33 
AnswerRe: Factorials PinmemberMatthew Butler24-Jun-08 13:38 
GeneralRe: Factorials Pinmembercp987624-Jun-08 15:05 
GeneralRe: Factorials PinmvpLuc Pattyn24-Jun-08 16:02 
GeneralRe: Factorials Pinmembercp987624-Jun-08 21:09 
Hi Luc,
 
I haven't worked through your code (are you sure the countN's do the right thing?).
 
There is a little known fact (don't ask me how I know it!) that
 
if n = 5q+r with 0 <= r < 5
 
then n! has the same rightmost non-zero digit as 2^n x q! x r!
 
Using this the problems reduce easily.
 
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."

GeneralRe: Factorials PinmvpLuc Pattyn25-Jun-08 0:53 
GeneralRe: Factorials Pinmembercp987625-Jun-08 3:27 
GeneralRe: Factorials PinmvpLuc Pattyn25-Jun-08 3:34 
GeneralRe: Factorials Pinmembercp987625-Jun-08 3:40 
AnswerRe: Factorials Pinmembertim_one14-Jul-08 9:37 
AnswerRe: Factorials PinmemberArash Partow25-Jun-08 3:14 
GeneralRe: Factorials PinmemberIan Uy25-Jun-08 7:26 
QuestionHow to determine the next x,y coordinate for a tank in a 2-D game... PinmemberEdmundisme18-Jun-08 9:35 
AnswerRe: How to determine the next x,y coordinate for a tank in a 2-D game... Pinmember73Zeppelin18-Jun-08 12:38 
GeneralRe: How to determine the next x,y coordinate for a tank in a 2-D game... PinmemberMatthew Butler18-Jun-08 12:44 
GeneralRe: How to determine the next x,y coordinate for a tank in a 2-D game... Pinmember73Zeppelin18-Jun-08 23:00 
GeneralRe: How to determine the next x,y coordinate for a tank in a 2-D game... PinmemberEdmundisme18-Jun-08 13:00 
AnswerRe: How to determine the next x,y coordinate for a tank in a 2-D game... PinmemberMatthew Butler18-Jun-08 12:41 
GeneralRe: How to determine the next x,y coordinate for a tank in a 2-D game... PinmemberEdmundisme18-Jun-08 13:01 
JokeRe: How to determine the next x,y coordinate for a tank in a 2-D game... PinmvpCPallini18-Jun-08 22:19 
QuestionPolyline offset algorithm Pinmemberbeko16-Jun-08 22:59 
AnswerRe: Polyline offset algorithm PinmemberAlan Balkany17-Jun-08 5:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web03 | 2.8.150224.1 | Last Updated 23 Feb 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid