modular exponentiation?
|
06-23-2018, 11:49 PM
Post: #1
|
|||
|
|||
modular exponentiation?
A colleague recently posed a question for hiring new programmers..
"What is the least significant 10 digits of the series: 1^1+2^2+3^3 .. 1000^1000" ? Fairly easy, and I wrote about my solutions here: billduncan.org. I flunked the test as my two solutions weren't the java code he was looking for.. It was interesting that "dc" (the command line "reverse polish calculator") had a modular exponentiation operator while the algebraic "bc" command didn't. (At one time, "bc" was a wrapper around "dc", which suggests that this was a recent addition.) I also got thinking about how I'd solve it on my calculators.. HP-48 wouldn't be a big deal, but it might be tricky on earlier calcs like the HP-41.. Thoughts? One other thing came to mind, is there a way to insert LaTeX code for formulaes in this forum similar to the way I did it in my blog post? |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)