Hofstadter Q sequence

Submit

Your name:
File:
Open code-statistics:

Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.

Problem

The Hofstadter Q sequence is defined as:
q(1)=q(2)=1,
q(n)=q(n-q(n-1))+q(n-q(n-2)), n>2.

Print that the first 300 terms.

Options

exec is denied

now post-mortem time, all source codes will be revealed

Sample input:_

*NOTHING*

Sample output:

1
1
2
3
3
4
5
5
6
6
6
8
8
8
10
9
10
11
11
12
12
12
12
16
14
14
16
16
16
16
20
17
17
20
21
19
20
22
21
22
23
23
24
24
24
24
24
32
24
25
30
28
26
30
30
28
32
30
32
32
32
32
40
33
31
38
35
33
39
40
37
38
40
39
40
39
42
40
41
43
44
43
43
46
44
45
47
47
46
48
48
48
48
48
48
64
41
52
54
56
48
54
54
50
60
52
54
58
60
53
60
60
52
62
66
55
62
68
62
58
72
58
61
78
57
71
68
64
63
73
63
71
72
72
80
61
71
77
65
80
71
69
77
75
73
77
79
76
80
79
75
82
77
80
80
78
83
83
78
85
82
85
84
84
88
83
87
88
87
86
90
88
87
92
90
91
92
92
94
92
93
94
94
96
94
96
96
96
96
96
96
128
72
96
115
100
84
114
110
93
106
124
82
101
111
108
118
104
108
106
114
104
114
109
100
109
120
112
108
118
106
105
130
110
114
115
112
107
120
114
122
121
120
114
138
110
122
119
120
130
132
113
133
123
118
125
121
129
122
136
129
116
149
137
120
123
143
146
107
139
138
139
135
120
146
135
143
129
151
133
135
136
148
148
136
144
143
152
129
139
151
140
148
136
151
159
125
147
153
148
154
152
136
152
155
146
144
162
151
157

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1leonid420.02122012/01/19 00:22:500B / 21B / 19B
2clock490.01812012/01/22 15:20:530B / 23B / 23B
3jingoro530.02012012/01/23 12:26:050B / ?B / ?B

Perl _

RankUserSizeTimeDateStatistics
1teebee460.19002012/01/19 01:47:430B / 18B / 27B
2tybalt89470.06532012/01/18 13:45:310B / ?B / ?B
3Hem670.01242012/01/24 19:25:370B / 22B / 45B

Python _

RankUserSizeTimeDateStatistics
1leonid500.10422012/01/19 00:00:090B / ?B / ?B
2recursive520.07092012/01/18 01:15:080B / 27B / 23B
3twobit520.04722012/01/18 23:27:260B / 24B / 26B
4hallvabo640.04112012/01/18 06:12:070B / 32B / 30B

PHP _

RankUserSizeTimeDateStatistics
1teebee540.04912012/01/19 02:15:261B / 18B / 34B
2o-cn540.09672012/01/19 14:10:071B / 18B / 34B
3primo550.03422012/01/17 23:52:461B / 19B / 35B
4clock630.02922012/01/23 01:11:161B / 21B / 41B
5o-cn520.02952012/01/25 00:23:411B / ?B / ?B

Scheme _

RankUserSizeTimeDateStatistics
1kaki1260.38402012/01/23 07:22:200B / 58B / 58B
2kaki1220.04462013/03/25 05:59:370B / 53B / 63B

Arc _

RankUserSizeTimeDateStatistics
1pooq901.27612012/01/24 17:53:150B / 38B / 37B
2pooq671.74832012/01/25 18:06:130B / 27B / 33B

Io _

RankUserSizeTimeDateStatistics
1pooq770.09852012/01/23 21:30:410B / 51B / 25B
2pooq750.26962012/01/26 18:58:250B / 48B / 26B

JavaScript _

RankUserSizeTimeDateStatistics
1nn570.01862012/01/18 10:18:180B / 28B / 29B
2o-cn570.02052012/01/19 22:55:230B / 27B / 30B
3hakusui590.02362012/01/18 08:00:450B / 29B / 30B

Lua _

RankUserSizeTimeDateStatistics
1twobit660.01482012/01/18 23:33:430B / 36B / 27B
2pooq740.01782012/01/22 07:51:580B / 41B / 26B
3Hendrik870.02242012/01/22 22:43:190B / 53B / 30B
4pooq690.09422012/01/25 18:07:140B / 42B / 24B

Xtal _

RankUserSizeTimeDateStatistics
1teebee600.03102012/01/19 09:50:040B / 27B / 32B
2pooq820.10382012/01/18 10:41:350B / 42B / 39B
3pooq(teebee)520.17422012/01/25 14:08:280B / 24B / 28B

REXX _

RankUserSizeTimeDateStatistics
1pooq700.05252012/04/18 10:17:040B / 44B / 18B

BASIC _

RankUserSizeTimeDateStatistics
1hakusui650.01862012/01/19 22:57:210B / 36B / 26B
2pooq710.07852012/01/23 19:22:140B / 37B / 27B

J _

RankUserSizeTimeDateStatistics
1I., S.230.05912012/01/18 21:05:090B / 7B / 16B
2medialuna930.05432014/08/13 15:30:430B / ?B / ?B

C _

RankUserSizeTimeDateStatistics
1inaniwa750.01552012/01/18 10:34:260B / 35B / 40B
2smkt1090.01282012/01/18 09:33:210B / ?B / ?B
3teebee(inaniwa,I., S.)740.01402012/01/25 07:39:280B / 35B / 39B

Java _

RankUserSizeTimeDateStatistics
1teebee1010.09252012/01/21 19:35:170B / 56B / 42B
2hakusui1011.12402012/01/22 09:44:440B / 54B / 44B
3teebee(I., S.)1000.08962012/01/25 06:02:050B / 55B / 42B

Maxima _

RankUserSizeTimeDateStatistics
1pooq781.06542012/01/22 17:15:500B / 45B / 30B
2pooq(teebee)620.12582012/01/25 13:39:020B / 34B / 25B

Octave _

RankUserSizeTimeDateStatistics
1pooq850.33652012/01/24 19:31:450B / 48B / 35B
2pooq610.33362012/01/26 01:35:590B / 34B / 26B

AWK _

RankUserSizeTimeDateStatistics
1I., S.480.03632012/01/18 22:49:420B / 24B / 24B
2teebee480.03722012/01/19 06:39:110B / 23B / 25B
3teebee(I., S.)460.03122012/01/24 23:44:450B / 22B / 24B

bc _

RankUserSizeTimeDateStatistics
1teebee480.01522012/01/20 11:47:590B / 21B / 26B
2teebee(I., S.)430.01812012/01/25 01:16:170B / 17B / 25B

dc _

RankUserSizeTimeDateStatistics
1lvogel450.01382012/01/24 05:54:010B / 30B / 15B

R _

RankUserSizeTimeDateStatistics
1pooq690.42792012/01/18 23:24:230B / 33B / 34B
2pooq621.10102012/01/26 01:04:380B / 31B / 29B

GolfScript _

RankUserSizeTimeDateStatistics
1clock180.04772012/01/18 09:28:410B / 6B / 12B
2leonid180.04352012/01/19 00:36:200B / 5B / 13B
3twobit180.05532012/01/19 08:45:570B / 5B / 13B
4tails180.04442012/01/19 15:06:210B / 5B / 13B

Vim _

RankUserSizeTimeDateStatistics
1clock390.22742012/01/18 02:49:219B / 18B / 10B

Groovy _

RankUserSizeTimeDateStatistics
1hakusui581.28892012/01/17 23:17:590B / 31B / 26B
2nn581.39952012/01/18 10:17:300B / 30B / 27B

Language Ranking_

RankLangUserSizeScore
1GolfScriptclock1810000
2JI., S.237826
3Vimclock394615
4Rubyleonid424285
5bcteebee(I., S.)434186
6dclvogel454000
7Perlteebee463913
8AWKteebee(I., S.)463913
9Pythonleonid503600
10PHPo-cn523461
11Xtalpooq(teebee)523461
12JavaScriptnn573157
13Groovyhakusui583103
14Octavepooq612950
15Maximapooq(teebee)622903
16Rpooq622903
17BASIChakusui652769
18Luatwobit662727
19Arcpooq672686
20REXXpooq702571
21Cteebee(inaniwa,I., S.)742432
22Iopooq752400
23Javateebee(I., S.)1001800
24Schemekaki1221475

return top