Given n a positive integer greater than or equal to 1, write a function f(n) to calculate as efficiently as possible the sum of the first 1 to n powers of 2. Do not use any built in function to calculate the power of a number.Example: if n = 3: f(3)=2^1+2^2+2^3=2+4+8=14Your program will read the value of n from stdin and should output the value of f(n) on the next line.
Note: Any language is fine - preferably perl, python or ruby.
I've been working hard to find a Professional to assist you with your question, but sometimes finding the right Professional can take a little longer than expected.
I wonder whether you're ok with continuing to wait for an answer. If you are, please let me know and I will continue my search. If not, feel free to let me know and I will cancel this question for you.
Please note, I am just a moderator for this category, I can only try and find experts to help, I can't answer the question itself.
Yep that's absolutely fine - I'm more than happy to wait. :)
We will continue to look for a Professional to assist you.
Thank you for your patience,
You can ask me again using "For LogicPro only" at the start of your questions like other customers to get instant answers. It will ensure that question is for me.
Please bookmark my profile page:
so you can come back and ask me a question anytime.
We can continue the conversation until you’re satisfied and rate my answer as excellent. I can address follow up questions and I’m always here to help.
Thank you for using this site!
I have another question up at the moment which I'm thinking about assigning over to you if you're interested? I would need this for within the next couple of hours though but I'm happy to pay well for the request.
Develop a process that can consume web access log files and emit the following metrics:- No. of successful requests per minute- No. of error requests per minute- Mean response time per minute- MBs sent per minutePlease use the following Web access log file to verify your process:https://dl.dropboxusercontent.com/u/9679985/web-access.logLog format (http://httpd.apache.org/docs/2.2/mod/mod_log_config.html):"%a %l %u %t \"%r\" %>s %b %D"