A052222 Numbers whose sum of digits is 8.
8, 17, 26, 35, 44, 53, 62, 71, 80, 107, 116, 125, 134, 143, 152, 161, 170, 206, 215, 224, 233, 242, 251, 260, 305, 314, 323, 332, 341, 350, 404, 413, 422, 431, 440, 503, 512, 521, 530, 602, 611, 620, 701, 710, 800, 1007, 1016, 1025, 1034, 1043, 1052, 1061
Offset: 1
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..12870 (all terms <= 9 digits; terms 1..1000 from Vincenzo Librandi)
Crossrefs
Programs
-
Haskell
a052222 n = a052222_list !! (n-1) a052222_list = filter ((== 8) . a007953) [0..] -- Reinhard Zumkeller, Jul 17 2014
-
Magma
[n: n in [1..1500] | &+Intseq(n) eq 8 ]; // Vincenzo Librandi, Mar 08 2013
-
Mathematica
Select[Range[1500], Total[IntegerDigits[#]] == 8 &] (* Vincenzo Librandi, Mar 08 2013 *)
-
Python
from sympy.utilities.iterables import multiset_permutations def auptodigs(maxdigits): alst = [] for d in range(1, maxdigits+1): digset = "0"*(d-1) + "11111111222233445678" for p in multiset_permutations(digset, d): if p[0] != '0' and sum(map(int, p)) == 8: alst.append(int("".join(p))) return alst print(auptodigs(4)) # Michael S. Branicky, Aug 17 2021
Extensions
Offset changed from Bruno Berselli, Mar 07 2013
Comments