[seqfan] Implementing first 500 sequences in Java

Sean A. Irvine sairvin at xtra.co.nz
Fri Oct 29 05:35:16 CEST 2010


Over the last few months, in my spare time, I have attempted to implement
the first 500 sequences from the OEIS in Java.  I have implemented all but
34 of them (2 are erroneous sequences and the other 32 proved either too
hard or I was unable to get sufficient information about the sequence).

During this process, I detected and fixed (or will fix) quite a few
errors in the entries for these sequences, so it has been worthwhile
from that perspective alone.  In other cases, I was able fill out
additional terms.

The "easy" keyword wasn't always a good guide as too how hard implementing
a sequence would be.  Because I did this in Java, I had to build up quite
a lot of support for polynomials, generating functions, partitions, and
so on which I would get for free in Maple or Mathematica.  On the other
hand, other sequences involving string manipulation such as working with
individual digits were comparatively easy.

All the sequences implement a common interface.  You construct a sequence
by its OEIS number, and thereafter call next() to get subsequent terms.

The following list shows the number of terms my code can generate in 60
seconds for each sequence.  In one case it stops with out of memory,
in others marked "[finished]" the generation finished before 60 seconds
have elapsed (this can be because the sequence is finite, or exceeds
what is representable as a BigInteger, or due to other generation
limitations).

Test machine was Linux, 8-core, 2.27GHz Xeon, although none of my
implementations do any explicit multithreading.  The Java process
was given 7GB of RAM for each run (most sequences need nowhere near
this much RAM).

A000001 not-implemented
A000002 16688856
A000003 166182
A000004 14818937
A000005 4297675
A000006 5663398
A000007 16339173
A000008 15176033
A000009 271513
A000010 50700
A000011 16812
A000012 11411000
A000013 16886
A000014 167
A000015 404076
A000016 17014
A000017 deprecated
A000018 32
A000019 not-implemented
A000020 61 [finished]
A000021 32
A000022 100 [finished]
A000023 2997
A000024 32
A000025 610
A000026 2627640
A000027 16866677
A000028 1313861
A000029 17575
A000030 15852361
A000031 17512
A000032 22964
A000033 797
A000034 17156452
A000035 15944202
A000036 76
A000037 16270731
A000038 16643468
A000039 304
A000040 4534123
A000041 201911
A000042 8117
A000043 33
A000044 22271
A000045 23062
A000046 16786
A000047 22
A000048 17666
A000049 32
A000050 30
A000051 18081
A000052 7912930
A000053 29
A000054 25
A000055 2167
A000056 2627640
A000057 491
A000058 21
A000059 107460
A000060 77
A000061 33357
A000062 1590
A000063 not-implemented
A000064 12003794
A000065 197902
A000066 not-implemented
A000067 31
A000068 107762
A000069 17474809
A000070 201297
A000071 23082
A000072 31
A000073 19748
A000074 30
A000075 31
A000076 22
A000077 31
A000078 18846
A000079 18179
A000080 not-implemented
A000081 2608
A000082 2627640
A000083 not-implemented
A000084 2411
A000085 5978
A000086 2627640
A000087 8956
A000088 36
A000089 2627640
A000090 1486
A000091 73057
A000092 76
A000093 11016283
A000094 201738
A000095 79357
A000096 16133449
A000097 34791
A000098 26956
A000099 76
A000100 19746
A000101 26
A000102 18813
A000103 not-implemented
A000104 not-implemented
A000105 not-implemented
A000106 2347
A000107 697
A000108 11470
A000109 not-implemented
A000110 816
A000111 784
A000112 not-implemented
A000113 2627640
A000114 28483
A000115 17560735
A000116 10131
A000117 10264
A000118 2627641
A000119 33055
A000120 14168878
A000121 1982
A000122 10249105
A000123 7498395
A000124 9234462
A000125 9563557
A000126 23108
A000127 8407534
A000128 23108
A000129 15369
A000130 3918
A000131 not-implemented
A000132 5041
A000133 20
A000134 4361853
A000135 38
A000136 20
A000137 2013
A000138 3883
A000139 9214
A000140 176
A000141 2627641
A000142 3861
A000143 2627641
A000144 6724
A000145 5929
A000146 313
A000147 16218
A000148 655
A000149 191
A000150 11402
A000151 78
A000152 5329
A000153 3912
A000154 deprecated
A000155 226 [finished]
A000156 4761
A000157 not-implemented
A000158 137
A000159 308
A000160 53
A000161 1236053
A000162 not-implemented
A000163 520
A000164 60232
A000165 3651
A000166 3915
A000167 255 [finished]
A000168 7626
A000169 3536
A000170 14
A000171 159
A000172 8725
A000173 3
A000174 4850
A000175 120
A000176 21976
A000177 2716
A000178 264
A000179 3911
A000180 801
A000181 307
A000182 309
A000183 1438
A000184 11376
A000185 308
A000186 223
A000187 543
A000188 2627640
A000189 2627640
A000190 2627640
A000191 547
A000192 540
A000193 12855584
A000194 10151751
A000195 11247538
A000196 11518047
A000197 9 [out-of-memory]
A000198 not-implemented
A000199 306
A000200 123
A000201 11393915
A000202 9902874
A000203 2627640
A000204 23086
A000205 31
A000206 9692
A000207 10720
A000208 10081
A000209 281240 [finished]
A000210 1599
A000211 23006
A000212 9580990
A000213 19689
A000214 not-implemented
A000215 21
A000216 10302976
A000217 10012887
A000218 10468741
A000219 13645
A000220 139
A000221 13045129
A000222 313
A000223 75
A000224 2627640
A000225 17412
A000226 581
A000227 193
A000228 not-implemented
A000229 19
A000230 100
A000231 20
A000232 161
A000233 23296
A000234 39
A000235 183
A000236 9313598
A000237 not-implemented
A000238 78
A000239 3903
A000240 3915
A000241 not-implemented
A000242 600
A000243 597
A000244 13210
A000245 11320
A000246 3908
A000247 18055
A000248 797
A000249 304 [finished]
A000250 not-implemented
A000251 177
A000252 2627640
A000253 17992
A000254 3911
A000255 3914
A000256 2782
A000257 8728
A000258 784
A000259 236
A000260 2899
A000261 3908
A000262 3857
A000263 182
A000264 159
A000265 10794874
A000266 3844
A000267 11825375
A000268 48
A000269 469
A000270 161
A000271 3915
A000272 3586
A000273 46
A000274 3221
A000275 769
A000276 3910
A000277 10152892
A000278 42
A000279 687
A000280 29
A000281 555
A000282 47
A000283 23
A000284 16
A000285 22998
A000286 31
A000287 4422
A000288 18035
A000289 21
A000290 9863382
A000291 29
A000292 9561908
A000293 29
A000294 219
A000295 18107
A000296 815
A000297 9544109
A000298 29
A000299 135
A000300 591
A000301 31
A000302 11410
A000303 11
A000304 29
A000305 234
A000306 116
A000307 659
A000308 25
A000309 7525
A000310 44
A000311 765
A000312 3571
A000313 1119
A000314 80
A000315 not-implemented
A000316 2397
A000317 22
A000318 317
A000319 1018
A000320 542
A000321 5652
A000322 18318
A000323 76
A000324 21
A000325 18115
A000326 8880245
A000327 2154
A000328 1815
A000329 1018
A000330 9399917
A000331 168
A000332 11372784
A000333 26
A000334 18
A000335 203
A000336 23
A000337 18096
A000338 9918783
A000339 1652
A000340 13333
A000341 23
A000342 114
A000343 546
A000344 2829
A000345 47
A000346 2871
A000347 19
A000348 24
A000349 3899
A000350 423
A000351 10357
A000352 2861
A000353 171997
A000354 3690
A000355 300139
A000356 3310
A000357 587
A000358 19783
A000359 41
A000360 9651248
A000361 not-implemented
A000362 17939
A000363 10372
A000364 568
A000365 2189
A000366 307
A000367 318
A000368 532
A000369 215027
A000370 not-implemented
A000371 21
A000372 not-implemented
A000373 290
A000374 79230
A000375 12
A000376 10
A000377 2627641
A000378 10413643
A000379 1313779
A000380 1303
A000381 23131
A000382 19653
A000383 18189
A000384 12267033
A000385 34207
A000386 302
A000387 3922
A000388 1341
A000389 9249427
A000390 16
A000391 191
A000392 13341
A000393 102
A000394 2298950
A000395 545
A000396 31
A000397 156
A000398 491510
A000399 3896
A000400 9572
A000401 2230803
A000402 10
A000403 not-implemented
A000404 546688
A000405 534
A000406 38
A000407 3192
A000408 2973510
A000409 221
A000410 not-implemented
A000411 533
A000412 26
A000413 76
A000414 117617
A000415 571277
A000416 15
A000417 182
A000418 93
A000419 417025
A000420 9166
A000421 not-implemented
A000422 3488
A000423 1585
A000424 2093
A000425 310
A000426 796
A000427 13
A000428 171
A000429 90
A000430 4246688
A000431 3140
A000432 413
A000433 3281219
A000434 9
A000435 945
A000436 547
A000437 1054
A000438 not-implemented
A000439 9777574
A000440 1263
A000441 32152
A000442 1921
A000443 3678542
A000444 435
A000445 not-implemented
A000446 10
A000447 9627572
A000448 16
A000449 3895
A000450 297
A000451 1111
A000452 79022
A000453 11438
A000454 3834
A000455 10973512
A000456 8
A000457 3205
A000458 50
A000459 2466
A000460 13156
A000461 3029
A000462 291362
A000463 10007337
A000464 554
A000465 23
A000466 9074090
A000467 not-implemented
A000468 4511
A000469 1405675
A000470 1210
A000471 1433
A000472 20
A000473 510
A000474 not-implemented
A000475 3906
A000476 1381
A000477 29290
A000478 13107
A000479 not-implemented
A000480 9604341
A000481 10337
A000482 3898
A000483 3900
A000484 9175554
A000485 437
A000486 11364
A000487 9542
A000488 17392
A000489 508
A000490 569
A000491 21
A000492 1180
A000493 11990826
A000494 9570147
A000495 1432
A000496 3592
A000497 3191
A000498 11333
A000499 29456
A000500 1145

Sean.





More information about the SeqFan mailing list