This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A124970 #16 Jul 01 2021 12:12:46 %S A124970 7,1,9,41,81,146,194,306,369,425,594,689,866,1109,1161,1154,1361,1634, %T A124970 1781,1889,2141,2729,2609,3626,3366,3566,3449,3506,4241,4289,4826, %U A124970 5066,5381,7034,5561,6254,7229,7829,8186,8069,8126,8609,8921,8774,10386,11574,11129 %N A124970 Smallest positive integer which can be expressed as the ordered sum of 3 squares in exactly n different ways. %H A124970 Michael S. Branicky, <a href="/A124970/b124970.txt">Table of n, a(n) for n = 0..2102</a> %t A124970 f[n_] := Block[{k = 1}, While[Length@PowersRepresentations[k, 3, 2] != n, k++]; k]; Table[f[n], {n, 0, 44}] (* _Ray Chandler_, Oct 31 2019 *) %o A124970 (Python) %o A124970 from collections import Counter %o A124970 from itertools import count, combinations_with_replacement as mc %o A124970 def aupto(lim): %o A124970 sq = filter(lambda x: x<=lim, (i**2 for i in range(int(lim**(1/2))+2))) %o A124970 s3 = filter(lambda x: 0<x<=lim, (sum(m) for m in mc(sq, 3))) %o A124970 counts, alst = Counter(s3), [7] %o A124970 for n in count(1): %o A124970 mink = min((k for k in counts if counts[k]==n), default=False) %o A124970 if not mink: break %o A124970 alst.append(mink) %o A124970 return alst %o A124970 print(aupto(11600)) # _Michael S. Branicky_, Jul 01 2021 %Y A124970 Cf. A000451, A095809, A000437, A122699, A124966-A124971. %K A124970 nonn %O A124970 0,1 %A A124970 _Artur Jasinski_, Nov 14 2006, Nov 20 2006 %E A124970 Extended by _Ray Chandler_, Nov 30 2006 %E A124970 a(45) and beyond from _Michael S. Branicky_, Jul 01 2021