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.

A003634 Smallest positive integer that is n times its digit sum, or 0 if no such number exists.

This page as a plain text file.
%I A003634 M5054 #33 May 09 2023 19:45:31
%S A003634 1,18,27,12,45,54,21,72,81,10,198,108,117,126,135,144,153,162,114,180,
%T A003634 378,132,207,216,150,234,243,112,261,270,372,576,594,102,315,324,111,
%U A003634 342,351,120,738,756,516,792,405,230,423,432,441,450,918,312,954,972
%N A003634 Smallest positive integer that is n times its digit sum, or 0 if no such number exists.
%C A003634 a(n) = 0 for n = 62, 63, 65, ... (A003635). - _Robert G. Wilson v_, Aug 15 2000
%D A003634 J. H. Conway, personal communication.
%D A003634 Anthony Gardiner, Mathematical Puzzling, Dover Publications, Inc., Mineola, NY, 1987, Page 11.
%D A003634 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H A003634 Donovan Johnson, <a href="/A003634/b003634.txt">Table of n, a(n) for n = 1..10000</a>
%e A003634 a(3) = 27 because no number less than 27 has a digit sum equal to 3 times the number.
%t A003634 Do[k = n; While[Apply[Plus, RealDigits[k][[1]]]*n != k, k += n]; Print[k], {n, 1, 61}]
%t A003634 With[{ll=Select[Table[{n,n/Total[IntegerDigits[n]]},{n,1000}],IntegerQ[ #[[2]]]&]},Table[Select[ll,#[[2]]==i&,1][[1,1]],{i,60}]] (* _Harvey P. Dale_, Mar 09 2012 *)
%o A003634 (Python)
%o A003634 def sd(n): return sum(map(int, str(n)))
%o A003634 def a(n):
%o A003634   m = 1
%o A003634   while m != n*sd(m): m += 1
%o A003634   return m
%o A003634 print([a(n) for n in range(1,62)]) # _Michael S. Branicky_, Jan 18 2021
%o A003634 (Python)
%o A003634 from itertools import count, combinations_with_replacement
%o A003634 def A003634(n):
%o A003634     for l in count(1):
%o A003634         if 9*l*n < 10**(l-1): return 0
%o A003634         c = 10**l
%o A003634         for d in combinations_with_replacement(range(10),l):
%o A003634             if sorted(str(a:=sum(d)*n)) == [str(e) for e in d] and a>0:
%o A003634                 c = min(c,a)
%o A003634         if c < 10**l:
%o A003634             return c # _Chai Wah Wu_, May 09 2023
%Y A003634 Cf. A005349, A003635.
%K A003634 nonn,base,easy,look,nice
%O A003634 1,2
%A A003634 _N. J. A. Sloane_, _Mira Bernstein_