[ create a new paste ] login | about

Link: http://codepad.org/AYie6msb    [ raw code | output | fork ]

C, pasted on Nov 23:
1
2
3
4
5
6
7
8
9
10
#include <stdio.h>
void main(){
int i;
int UPPER_BOUND = 100;
for(i = 1;i<=UPPER_BOUND;i++){
int x=i;
int ans = 2*(x*x) + 2*x + 1;
printf("%d\n",ans);
}
}


Output:
5
13
25
41
61
85
113
145
181
221
265
313
365
421
481
545
613
685
761
841
925
1013
1105
1201
1301
1405
1513
1625
1741
1861
1985
2113
2245
2381
2521
2665
2813
2965
3121
3281
3445
3613
3785
3961
4141
4325
4513
4705
4901
5101
5305
5513
5725
5941
6161
6385
6613
6845
7081
7321
7565
7813
8065
8321
8581
8845
9113
9385
9661
9941
10225
10513
10805
11101
11401
11705
12013
12325
12641
12961
13285
13613
13945
14281
14621
14965
15313
15665
16021
16381
16745
17113
17485
17861
18241
18625
19013
19405
19801
20201


Create a new paste based on this one


Comments: