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 A052220 #35 Jun 30 2025 02:24:21 %S A052220 6,15,24,33,42,51,60,105,114,123,132,141,150,204,213,222,231,240,303, %T A052220 312,321,330,402,411,420,501,510,600,1005,1014,1023,1032,1041,1050, %U A052220 1104,1113,1122,1131,1140,1203,1212,1221,1230,1302,1311,1320,1401,1410 %N A052220 Numbers whose sum of digits is 6. %C A052220 A007953(a(n)) = 6; number of repdigits = #{6,33,222,111111} = A242627(6) = 4. - _Reinhard Zumkeller_, Jul 17 2014 %C A052220 There are binomial(t + 4, 5) terms having exactly t digits. Therefore binomial(t + 5, 6) have at most t digits. - _David A. Corneth_, Jun 29 2025 %H A052220 Michael S. Branicky, <a href="/A052220/b052220.txt">Table of n, a(n) for n = 1..12376</a> (terms 1..924 from Vincenzo Librandi; all terms with <= 12 digits) %F A052220 a(n) = a(n-1) + 10^v * (10 - c) + c-1 where c is the last nonzero digit of a(n) and v is the 10-adic valuation of a(n-1) and n > 1. - _David A. Corneth_, Jun 29 2025 %e A052220 1023 is in the sequence as it has digital sum 1 + 0 + 2 + 3 = 6. - _David A. Corneth_, Jun 29 2025 %t A052220 Select[Range[10^4], Total[IntegerDigits[#]] == 6 &] (* _Vincenzo Librandi_, Mar 07 2013 *) %o A052220 (Magma) [n: n in [1..1500] | &+Intseq(n) eq 6 ]; // _Vincenzo Librandi_, Mar 07 2013 %o A052220 (Haskell) %o A052220 a052220 n = a052220_list !! (n-1) %o A052220 a052220_list = filter ((== 6) . a007953) [0..] %o A052220 -- _Reinhard Zumkeller_, Jul 17 2014 %o A052220 (Python) %o A052220 from sympy.utilities.iterables import multiset_permutations %o A052220 def auptodigs(maxdigits): %o A052220 alst = [] %o A052220 for d in range(1, maxdigits+1): %o A052220 digset = "0"*(d-1) + "11111122233456" %o A052220 for p in multiset_permutations(digset, d): %o A052220 if p[0] != '0' and sum(map(int, p)) == 6: %o A052220 alst.append(int("".join(p))) %o A052220 return alst %o A052220 print(auptodigs(4)) # _Michael S. Branicky_, Jun 15 2021 %o A052220 (PARI) nxt(n) = {my(v, c, toadd); v = valuation(n, 10); c = (n / 10^v)%10; toadd = 10^(v)*(10 - c) + c - 1; return(n + toadd)} \\ _David A. Corneth_, Jun 29 2025 %Y A052220 Cf. A007953. %Y A052220 Cf. A011557 (1), A052216 (2), A052217 (3), A052218 (4), A052219 (5), 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 A052220 Cf. A242614, A242627. %K A052220 nonn,base,easy %O A052220 1,1 %A A052220 _Henry Bottomley_, Feb 01 2000 %E A052220 Offset changed by _Bruno Berselli_, Mar 07 2013