Best writers. Best papers. Let professionals take care of your academic papers

Order a similar paper and get 15% discount on your first order with us
Use the following coupon "FIRST15"
ORDER NOW

Question I am trying to code a function that calculates a “Shaffer” number. So a “Shaffer” number starts with 1, then each successive number is equal to double the current number, and then 3 added to that. So, first few numbers are as follows: 1 // Now double it, plus 3 5 // Now double it, plus 3 13 // etc. I am getting stuck when it pulls the wrong value out. For example, my code pulls the number 5, when it should be 61.

Question

I am trying to code a function that calculates a “Shaffer” number. So a “Shaffer” number starts

with 1, then each successive number is equal to double the current number, and then 3 added to that. So, first few numbers are as follows:

1 // Now double it, plus 3

5 // Now double it, plus 3

13 // etc.

I am getting stuck when it pulls the wrong value out. For example, my code pulls the number 5, when it should be 61.

 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"