Notes
for nemo
Pages
Home
C / Linux
Data Structures & Algorithms
UVa Problems
Interview Problems
More
Sunday, May 19, 2013
10515 - Powers Et Al.
http://mathcentral.uregina.ca/QQ/database/QQ.09.04/landon1.html
http://khvmathematics.blogspot.com/2008/01/how-to-find-last-digit-of-any-number.html
(1) Divide n by 4
(2) If the remainder is r, then the last digit is ((m%10)^r)%10.
(3) if the remainder is zero, set r=4 and do (2).
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment