Challenge: First Digit of Factorial Programme - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: General Forum (/forum-4.html) +--- Thread: Challenge: First Digit of Factorial Programme (/thread-9637.html) |
Challenge: First Digit of Factorial Programme - Gerald H - 12-05-2017 08:11 AM The challenge is to produce a programme that for natural number input N returns the first, ie leftmost, digit of N! on the 50g. The programme below uses the formula here http://mathworld.wolfram.com/StirlingsApproximation.html & gives correct answers for input 0 to 5,362. The OEIS reference is here Edit: Was wrong link. https://oeis.org/A008905 Speed is the secondary consideration & accuracy the first. I don't expect my programme to be bettered but would be very pleased to be proven wrong. Size: 76. CkSum: # 86A4h Code: :: |