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.

A052221 Numbers whose sum of digits is 7.

This page as a plain text file.
%I A052221 #27 Sep 08 2022 08:44:59
%S A052221 7,16,25,34,43,52,61,70,106,115,124,133,142,151,160,205,214,223,232,
%T A052221 241,250,304,313,322,331,340,403,412,421,430,502,511,520,601,610,700,
%U A052221 1006,1015,1024,1033,1042,1051,1060,1105,1114,1123,1132,1141,1150,1204
%N A052221 Numbers whose sum of digits is 7.
%C A052221 A007953(a(n)) = 7; number of repdigits = #{7,1111111} = A242627(7) = 2. - _Reinhard Zumkeller_, Jul 17 2014
%H A052221 Vincenzo Librandi, <a href="/A052221/b052221.txt">Table of n, a(n) for n = 1..1000</a>
%t A052221 Select[Range[1500],Total[IntegerDigits[#]]==7&] (* _Harvey P. Dale_, Apr 11 2012 *)
%o A052221 (Magma) [n: n in [1..1500] | &+Intseq(n) eq 7 ]; // _Vincenzo Librandi_, Mar 08 2013
%o A052221 (Haskell)
%o A052221 a052221 n = a052221_list !! (n-1)
%o A052221 a052221_list = filter ((== 7) . a007953) [0..]
%o A052221 -- _Reinhard Zumkeller_, Jul 17 2014
%o A052221 (Python)
%o A052221 def ok(n): return sum(map(int, str(n))) == 7
%o A052221 print(list(filter(ok, range(1205)))) # _Michael S. Branicky_, Jul 16 2021
%o A052221 (Python) # faster version generating initial segment
%o A052221 from sympy.utilities.iterables import multiset_permutations
%o A052221 def auptodigs(maxdigits):
%o A052221     alst = []
%o A052221     for d in range(1, maxdigits+1):
%o A052221         digset = "0"*(d-1) + "1111111222334567"
%o A052221         for p in multiset_permutations(digset, d):
%o A052221             if p[0] != '0' and sum(map(int, p)) == 7:
%o A052221                 alst.append(int("".join(p)))
%o A052221     return alst
%o A052221 print(auptodigs(4)) # _Michael S. Branicky_, Jul 16 2021
%Y A052221 Supersequence of A119461.
%Y A052221 Cf. A007953, A242614, A242627.
%Y A052221 Cf. A011557 (1), A052216 (2), A052217 (3), A052218 (4), A052219 (5), A052220 (6), 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).
%K A052221 nonn,base,easy
%O A052221 1,1
%A A052221 _Henry Bottomley_, Feb 01 2000
%E A052221 Offset changed from _Bruno Berselli_, Mar 07 2013