Advertisement
skb50bd

1 6 15 28 45 Sequence

Feb 29th, 2016
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.23 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.     int n;
  6.     cout <<  "How many terms: ";
  7.     cin >> n;
  8.     for(int i = 0; i < n; i++)
  9.         cout << 2 * i * i + 3 * i + 1 << " ";
  10.     cout << endl;
  11.  
  12.     return 0;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement