Display OEIS sequences

Python 2, 875 sequences

print', '.join('%020d'%(10**20/(input()-21004)))

Works for 875 of the sequences 21016 (decimal digits of 1/12) through 21999 (decimal digits of 1/995).

I found this chunk with the sophisticated search algorithm of haphazardly typing in sequence id's by hand. Some of the sequences in the range are not of this format and appear elsewhere (thanks to Mitchell Spector for pointing this out). For example, 21021 is not the expansion of 1/17.

Even with the interruptions, the sequences for 1/n appear as id n+21004. The remainder is not shifted, but the missing sequences appear elsewhere. For example, 1/17 appears as 7450.

I counted the ones that match using a downloaded copy of the sequence names.

A different block gives 848 sequences from 16742 to 17664.

n=input()-16729
for i in range(20):k=n/12;a=int((8*k+1)**.5/2+.5);print(a*i+k-a*(a-1)/2)**(n%12+1)

These all have form n -> (a*n+b)^c, where 2≤a≤12, 0≤b<a, 1≤c≤12. The code extracts the coefficients via inverting triangular numbers and moduli. As before, not all sequences in the range match. If these two expressions could fit in 100 bytes, it would give 1723 sequences.

Promising chunks:

  • 1929 matching sequences: 41006 through 42397, numerators and denominators of continued fraction convergents.
  • ~3300 matching sequences: 147999 to 151254: counts of walks on Z^3, if you can find how the vector lists are ordered.

Here are categories for other potential chunks, via grouping the OEIS sequence names by removing all numbers (digits, minus sign, decimal point). They are sorted by number of appearances.

3010    Number of walks within N^ (the first octant of Z^) starting at (,,) and consisting of n steps taken from {(, , ), (, , ), (, , ), (, , ), (, , )}
2302    Number of reduced words of length n in Coxeter group on  generators S_i with relations (S_i)^ = (S_i S_j)^ = I
979     Primes congruent to  mod 
969     Numerators of continued fraction convergents to sqrt()
967     Denominators of continued fraction convergents to sqrt()
966     Continued fraction for sqrt()
932     Decimal expansion of /
894     Duplicate of A
659     Partial sums of A
577     Divisors of 
517     Inverse of th cyclotomic polynomial
488     Expansion of /((x)(x)(x)(x))
480     Decimal expansion of th root of 
471     Number of nX  arrays with each element x equal to the number its horizontal and vertical neighbors equal to ,,,, for x=,,,,
455     First differences of A
448     Decimal expansion of log_ ()
380     Numbers n such that string , occurs in the base  representation of n but not of n+
378     Erroneous version of A
375     Numbers n such that string , occurs in the base  representation of n but not of n
340     Numbers n with property that in base  representation the numbers of 's and 's are  and , respectively

35 sequences:

c=input()
for n in range(20):print[(c-1010)**n,(c-8582)*n][c>2e3]

Works from 8585 (multiples of 3) through 8607 (multiples of 25), and 1018 (powers of 8) through 1029 (powers of 19). Conveniently, these are all in one chunk ordered by id.

This uses only 65 of the 100 allowed bytes and isn't fully golfed yet, so I'll look for another nice chunk.


Bash + coreutils, 252 sequences

yes 0|head -20

Try it online!

Works on 252 OEIS sequences: A000004, A006983, A011734, A011735, A011736, A011737, A011738, A011739, A011740, A011741, A011742, A011743, A011744, A011745, A023975, A023976, A025438, A025439, A025443, A025444, A025466, A025469, A034422, A034423, A034427, A034429, A034432, A034435, A034437, A034438, A034439, A034441, A034443, A034445, A034447, A034449, A034450, A034451, A034452, A034453, A034454, A034455, A034456, A034457, A034458, A034459, A034461, A034462, A034464, A034465, A034466, A034467, A034468, A034469, A034471, A034473, A034475, A034476, A034477, A034479, A034480, A034481, A034482, A034483, A034484, A034485, A034486, A034487, A034489, A034490, A034492, A034493, A034495, A034497, A034498, A034499, A034500, A034501, A034502, A034503, A034504, A034505, A034506, A034507, A034508, A034509, A034510, A034511, A034512, A034514, A034515, A034516, A034518, A034519, A034520, A034521, A034522, A034523, A034525, A034526, A034527, A034528, A034529, A034530, A034531, A034532, A034533, A034534, A034535, A034536, A034537, A034538, A034539, A034540, A034541, A034542, A034543, A034544, A034545, A034546, A034547, A034548, A034549, A034550, A034551, A034552, A034553, A034554, A034555, A034556, A034557, A034558, A034559, A034560, A034561, A034562, A034563, A034564, A034565, A034566, A034567, A034568, A034569, A034570, A034571, A034572, A034573, A034574, A034575, A034576, A034577, A034578, A034579, A034580, A034581, A034582, A036861, A047752, A052375, A055967, A061858, A065687, A066035, A067159, A067168, A070097, A070202, A070204, A070205, A070206, A072325, A072769, A076142, A082998, A083344, A085974, A085982, A086007, A086015, A089458, A093392, A094382, A105517, A108322, A111855, A111859, A111898, A111899, A112802, A122180, A129947, A137579, A159708, A161277, A161278, A161279, A161280, A165766, A167263, A178780, A178798, A180472, A180601, A181340, A181735, A184946, A185037, A185203, A185237, A185238, A185245, A185246, A185255, A185264, A185284, A191928, A192541, A197629, A198255, A200214, A206499, A210632, A212619, A217148, A217149, A217151, A217155, A217156, A228953, A230533, A230686, A235044, A235358, A236265, A236417, A236460, A238403, A243831, A243832, A243833, A243834, A243835, A243836, A248805, A250002, A256974, A260502, A264668, A276183, A277165, A280492, A280815


CJam (2182 2780 3034 sequences)

{:ZA3#:Cb(40-z_!!:B-\+CbB)/)_mqmo:M+:NK{)[N0{N1$_*-@/M@+1$md@M@-}K*]<W%B{X0@{2$*+\}%}*ZB&=}%\C)<f*}

This gives correct answers for the inclusive ranges

  • [A040000, A040003], [A040005, A040008], [A040011, A040013], A040015, [A040019, A040022], A040024, [A040029, A040033], A040035, A040037, [A040041, A040043], A040048, A040052, [A040055, A040057], A040059, A040063, [A040071, A040074], A040077, A040080, [A040090, A040091], [A040093, A040094], A040097, A040099, [A040109, A040111], A040118, A040120, [A040131, A040135], A040137, A040139, [A040142, A040143], A040151, [A040155, A040157], A040166, A040168, [A040181, A040183], [A040185, A040968]
  • [A041006, A041011], [A041014, A042937]
  • A006983, [A011734, A011745], [A023975, A023976], [A025438, A025439], [A025443, A025444], A025466, A025469, [A034422, A034423], A034427, A034429, A034432, A034435, [A034437, A034439], A034441, A034443, A034445, A034447, [A034449, A034459], [A034461, A034462], [A034464, A034469], A034471, A034473, [A034475, A034477], [A034479, A034487], [A034489, A034490], [A034492, A034493], A034495, [A034497, A034512], [A034514, A034516], [A034518, A034523], [A034525, A034582], A036861, A047752, A052375, A055967, A061858, A065687, A066035, A067159, A067168, A070097, A070202, A070204, [A070205, A070206], A072325, A072769, A076142, A082998, A083344, A085974, A085982, A086007, A086015, A089458, A093392, A094382, A105517, A108322, A111855, A111859, [A111898, A111899], A112802, A122180, A129947, A137579, A159708, [A161277, A161280], A165766, A167263, A178780, A178798, A180472, A180601, A181340, A181735, A184946, A185037, A185203, [A185237, A185238], [A185245, A185246], A185255, A185264, A185284, A191928, A192541, A197629, A198255, A200214, A206499, A210632, A212619, [A217148, A217149], A217151, [A217155, A217156], A228953, A230533, A230686, A235044, A235358, A236265, A236417, A236460, A238403, [A243831, A243836], A248805, A250002, A256974, A260502, A264668, A276183, A277165, A280492, A280815

The A040??? sequences correspond to the continued fractions of non-rational square roots from sqrt(2) to sqrt(1000) (with the gaps corresponding to ones which appear earlier in OEIS, but conveniently filled with random sequences). The A041??? sequences correspond to the numerators and denominators of the continued fraction convergents for non-rational square roots from sqrt(6) to sqrt(1000) (with the gap corresponding to sqrt(10), at A005667 and A005668). The other assorted sequences have zeroes for their first twenty values.

The answer ports elements of two earlier answers of mine in GolfScript:

  • Determining the continued fractions of square roots
  • Good rational approximations of pi

Many thanks to xnor for the short closed form x -> x + round(sqrt(x)) mapping sequence offsets to the value to sqrt. The savings over my previous calculation (generating the list of non-squares and selecting by index) provided enough to have an all-zero fallback for most out-of-range indices.