cp's OEIS Frontend

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.

A052219 Numbers whose sum of digits is 5.

This page as a plain text file.
%I A052219 #28 Sep 08 2022 08:44:59
%S A052219 5,14,23,32,41,50,104,113,122,131,140,203,212,221,230,302,311,320,401,
%T A052219 410,500,1004,1013,1022,1031,1040,1103,1112,1121,1130,1202,1211,1220,
%U A052219 1301,1310,1400,2003,2012,2021,2030,2102,2111,2120,2201,2210,2300,3002
%N A052219 Numbers whose sum of digits is 5.
%C A052219 A007953(a(n)) = 5; number of repdigits = #{5,11111} = A242627(5) = 2. - _Reinhard Zumkeller_, Jul 17 2014
%H A052219 Michael S. Branicky, <a href="/A052219/b052219.txt">Table of n, a(n) for n = 1..11628</a> (all terms through 15 digits; terms 1..1287 from Vincenzo Librandi and T. D. Noe, terms 1..462 from Vincenzo Librandi)
%t A052219 Select[Range[10^4], Total[IntegerDigits[#]] == 5 &] (* _Vincenzo Librandi_, Mar 07 2013 *)
%t A052219 Union[Flatten[Table[FromDigits /@ Permutations[PadRight[s, 9]], {s, IntegerPartitions[5]}]]] (* _T. D. Noe_, Mar 08 2013 *)
%o A052219 (Magma) [n: n in [1..3010] | &+Intseq(n) eq 5 ]; // _Vincenzo Librandi_, Mar 07 2013
%o A052219 (Haskell)
%o A052219 a052219 n = a052219_list !! (n-1)
%o A052219 a052219_list = filter ((== 5) . a007953) [0..]
%o A052219 -- _Reinhard Zumkeller_, Jul 17 2014
%o A052219 (PARI) isok(n) = sumdigits(n) == 5; \\ _Michel Marcus_, Dec 28 2015
%o A052219 (Python)
%o A052219 from sympy.utilities.iterables import multiset_permutations
%o A052219 def auptodigs(maxdigits):
%o A052219   alst = [5]
%o A052219   for d in range(2, maxdigits+1):
%o A052219     fulldigset = list("0"*(d-1) + "1111122345")
%o A052219     for firstdig in "12345":
%o A052219       target_sum, restdigset = 5-int(firstdig), fulldigset[:]
%o A052219       restdigset.remove(firstdig)
%o A052219       for p in multiset_permutations(restdigset, d-1):
%o A052219         if sum(map(int, p)) == target_sum:
%o A052219           alst.append(int(firstdig+"".join(p)))
%o A052219           if int(p[0]) == target_sum: break
%o A052219   return alst
%o A052219 print(auptodigs(4)) # _Michael S. Branicky_, May 14 2021
%Y A052219 Cf. A007953.
%Y A052219 Cf. A011557 (1), A052216 (2), A052217 (3), A052218 (4), 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 A052219 Cf. A242614, A242627.
%K A052219 nonn,base,easy
%O A052219 1,1
%A A052219 _Henry Bottomley_, Feb 01 2000
%E A052219 Offset changed from _Bruno Berselli_, Mar 07 2013