Chat with our AI personalities
Oh, dude, twice n is just like if you take n and double it. So, if n is 5, twice n would be 10. It's basically just adding n to itself once. Easy peasy, right?
After n years of 7 percent growth, the value is (1.07)n times the starting value. The answer to the question is the smallest value of n such that (1.07)n >=2 or nlog(1.07)>= log(2) or n >= log(2)/log(1.07) = 10.2 So the GDP will double during the 11th year.
#include<iostream> struct shape { virtual double perimeter() const = 0; virtual double area() const = 0; }; struct circle : shape { circle (double radius): r(radius), pi(4*atan(1)) {} double perimeter() const { return 2*pi*r; } double area() const { return pi*r*r; } private: double r; const double pi; }; struct rectangle : shape { rectangle (double width, double height): w(width), h(height) {} double perimeter() const { return 2*(w+h); } double area() const { return w*h; } private: double w; double h; }; int main() { using std::cout; using std::endl; circle c (3.0); cout << "Circle with radius 3.0\n"; cout << "\tPerimiter: " << c.perimiter() << '\n'; cout << "\tArea: " << c.area() << '\n'; cout << endl; rectangle r (4.0, 5.0); cout << "Rectangle with width 4.0 and height 5.0\n"; cout << "\tPerimiter: " << r.perimiter() << '\n'; cout << "\tArea: " << r.area() << '\n'; cout << endl; }
2(n + 10)
You get a sequence of doubled triangular numbers. This sequence can also be represented by Un = n*(n + 1), [products of pairs of consecutive integers]