Farey 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

Given n, output Farey sequence of order n.
http://en.wikipedia.org/wiki/Farey_sequence

Options

exec is denied

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

Sample input:_

3

Sample output:

0/1
1/3
1/2
2/3
1/1

Sample input:_

5

Sample output:

0/1
1/5
1/4
1/3
2/5
1/2
3/5
2/3
3/4
4/5
1/1

Sample input:_

8

Sample output:

0/1
1/8
1/7
1/6
1/5
1/4
2/7
1/3
3/8
2/5
3/7
1/2
4/7
3/5
5/8
2/3
5/7
3/4
4/5
5/6
6/7
7/8
1/1

Ranking

Perl _

RankUserSizeTimeDateStatistics
1teebee500.00362011/03/23 03:56:340B / 15B / 34B
2tybalt89500.00712011/04/05 00:26:460B / ?B / ?B
3tails682.60982011/03/23 00:55:460B / 28B / 38B

Python _

RankUserSizeTimeDateStatistics
1hirose720.07312011/03/23 14:42:090B / 37B / 32B
2twobit820.07182011/03/23 04:34:320B / 42B / 37B
3hallvabo820.07392011/04/05 02:59:060B / 42B / 38B
4recursive830.07102011/03/26 05:40:430B / 42B / 37B

Scheme _

RankUserSizeTimeDateStatistics
1youz830.17722011/03/25 13:10:010B / 36B / 40B
2kaki840.18572011/03/28 20:40:230B / 43B / 36B
3kaki820.10642013/03/25 06:59:320B / 39B / 40B

Common LISP _

RankUserSizeTimeDateStatistics
1youz790.26162011/03/23 23:55:360B / 35B / 38B
2kozima800.28452011/03/25 17:41:290B / 40B / 36B

Arc _

RankUserSizeTimeDateStatistics
1youz795.98172011/03/24 22:57:120B / 43B / 25B

Clojure _

RankUserSizeTimeDateStatistics
1youz1125.49602011/04/05 13:01:020B / 47B / 53B

Io _

RankUserSizeTimeDateStatistics
1pooq1320.48432011/08/09 17:45:160B / 76B / 52B

JavaScript _

RankUserSizeTimeDateStatistics
1nn792.23812011/04/02 13:01:460B / 42B / 37B

Lua _

RankUserSizeTimeDateStatistics
1twobit1030.00312011/03/23 04:21:460B / 56B / 40B
2pooq(hirose)920.00302011/08/13 01:09:180B / 49B / 39B

Xtal _

RankUserSizeTimeDateStatistics
1pooq(hirose)900.08322011/08/13 01:02:040B / 47B / 42B

Prolog _

RankUserSizeTimeDateStatistics
1pooq(hirose)1110.14462011/08/13 08:55:520B / 56B / 48B

BASIC _

RankUserSizeTimeDateStatistics
1*yuko*750.04602011/06/22 23:39:120B / 40B / 35B

J _

RankUserSizeTimeDateStatistics
1pooq470.50062011/03/26 22:36:380B / 11B / 35B
2I., S.430.10802011/08/10 22:28:320B / 10B / 32B

C _

RankUserSizeTimeDateStatistics
1not940.09012011/03/23 02:05:300B / 46B / 48B
2nn940.09522011/04/05 00:19:580B / 46B / 48B
3hos980.00212011/03/22 15:56:380B / 47B / 51B
4inaniwa1330.00212011/03/23 21:42:290B / 63B / 70B

OCaml _

RankUserSizeTimeDateStatistics
1m.ukai2020.13002011/03/24 18:00:030B / 107B / 79B

Haskell _

RankUserSizeTimeDateStatistics
1notogawa1070.01892011/03/22 22:59:380B / 70B / 32B

Pascal _

RankUserSizeTimeDateStatistics
1*yuko*1240.00432011/04/05 00:43:140B / 72B / 42B
2*yuko*1210.03292011/06/22 23:27:180B / 71B / 40B

Fortran _

RankUserSizeTimeDateStatistics
1*yuko*870.02632011/04/03 09:26:240B / 48B / 38B

Maxima _

RankUserSizeTimeDateStatistics
1pooq1030.71342011/03/26 22:37:180B / 63B / 39B

AWK _

RankUserSizeTimeDateStatistics
1houmei1050.00252011/04/01 23:34:420B / ?B / ?B

R _

RankUserSizeTimeDateStatistics
1pooq(hirose)970.88962011/08/22 21:55:340B / 44B / 52B

z80 _

RankUserSizeTimeDateStatistics
1*yuko*530.20292011/04/03 14:07:4523B / 16B / 12B

Groovy _

RankUserSizeTimeDateStatistics
1nn767.10982011/03/27 12:03:520B / 48B / 28B

Logo _

RankUserSizeTimeDateStatistics
1teebee1060.08042011/03/25 06:53:010B / 64B / 23B

Language Ranking_

RankLangUserSizeScore
1JI., S.4310000
2Perlteebee508600
3z80*yuko*538113
4Pythonhirose725972
5BASIC*yuko*755733
6Groovynn765657
7Common LISPyouz795443
8Arcyouz795443
9JavaScriptnn795443
10Schemekaki825243
11Fortran*yuko*874942
12Xtalpooq(hirose)904777
13Luapooq(hirose)924673
14Cnot944574
15Rpooq(hirose)974432
16Maximapooq1034174
17AWKhoumei1054095
18Logoteebee1064056
19Haskellnotogawa1074018
20Prologpooq(hirose)1113873
21Clojureyouz1123839
22Pascal*yuko*1213553
23Iopooq1323257
24OCamlm.ukai2022128

return to the top page