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 A052218 #31 May 16 2022 02:35:58 %S A052218 4,13,22,31,40,103,112,121,130,202,211,220,301,310,400,1003,1012,1021, %T A052218 1030,1102,1111,1120,1201,1210,1300,2002,2011,2020,2101,2110,2200, %U A052218 3001,3010,3100,4000,10003,10012,10021,10030,10102,10111,10120,10201,10210,10300 %N A052218 Numbers whose sum of digits is 4. %C A052218 A007953(a(n)) = 4; number of repdigits = #{4,22,1111} = A242627(4) = 3. - _Reinhard Zumkeller_, Jul 17 2014 %H A052218 Michael S. Branicky, <a href="/A052218/b052218.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..1001 from Vincenzo Librandi and T. D. Noe, terms 1..201 from Vincenzo Librandi) %t A052218 Select[Range[10^5], Total[IntegerDigits[#]] == 4 &] (* _Vincenzo Librandi_, Mar 07 2013 *) %t A052218 Union[Flatten[Table[FromDigits /@ Permutations[PadRight[s, 11]], {s, IntegerPartitions[4]}]]] (* _T. D. Noe_, Mar 08 2013 *) %o A052218 (Magma) [n: n in [1..10300] | &+Intseq(n) eq 4 ]; // _Vincenzo Librandi_, Mar 07 2013 %o A052218 (Haskell) %o A052218 a052218 n = a052218_list !! (n-1) %o A052218 a052218_list = filter ((== 4) . a007953) [0..] %o A052218 -- _Reinhard Zumkeller_, Jul 17 2014 %o A052218 (PARI) isok(n) = sumdigits(n) == 4; \\ _Michel Marcus_, Dec 28 2015 %o A052218 (Python) %o A052218 from itertools import count, islice %o A052218 def agen(): yield from (10**i + 10**j + 10**k + 10**m for i in count(0) for j in range(i+1) for k in range(j+1) for m in range(k+1)) %o A052218 print(list(islice(agen(), 45))) # _Michael S. Branicky_, May 15 2022 %Y A052218 Cf. A007953. %Y A052218 Cf. A011557 (1), A052216 (2), A052217 (3), A052219 (5), A052220 (6), A052221 (7), A052222 (8), A052223 (9), A052224 (10), A166311 (11), A235151 (12), A143164 (13), A235225(14), A235226 (15), A235227 (16), A166370 (17), A235228 (18), A166459 (19), A235229 (20). %Y A052218 Cf. A242614, A242627. %K A052218 nonn,base,easy %O A052218 1,1 %A A052218 _Henry Bottomley_, Feb 01 2000 %E A052218 Offset changed from _Bruno Berselli_, Mar 07 2013